Cleanup everything and move .js out

Here's the cleanup I did.