Fixed other bugs related to HTML 5 requirements, and removed some old and unused code from JS