You might want to check with your ISP and find out what is compatible if you decide to get a new modem.
You can use the current gateway though and attach the new router configured as an access point, so you can use the wireless. Pretty much any modem will work in AP mode by just turning DHCP off and giving it a static address, then attaching it LAN to LAN to your current TG787.
Your best choice at $50 will probably be a TP-Link model, if you can stretch a little further, I would recommend an ASUS RT-N56U.