Added dynamic framerate adjustment to the HTML

Also fixed a bug where framerate wouldn't set properly.