Migrate the site to use JavaScript instead of PHP

Rewrote some of the logic to all be in JavaScript. This is so NewtBites can be used on a static site. 

For shits and giggles, I tried as hard as I could to minimize the changes made in sentence.[php|js], mostly as in exercise in how similar PHP and JS can be. 

Tested locally.