Remove main.js
Moved code loading into index.html
Added error throwing system.