Fix misconforming HTML
Moved JS into a new file