fixed a bunch of minor issues, updated javascript, added toggle to html, added toggle functionality to javascript, added toggle controller to php, added set-template function to php