Separated HTML and Javascript

Moved the javascript in index.html  to its own file.