Cleanup to javascripts; made them into a sinple main.js