Cleaned up, combined and updated JS.
Added FOUT prevention, could be hairy because it's applied to html.