Change insertion of JS from footer to htaccess

main.js is now included with IndexHeadInsert in the htaccess file
Errors resolved