Decoupling javascript and CSS

Sorry I'm a bit new at the PR's here. There are two commits in this PR, but both have detailed commit messages.