Split code

Put a couple of things in their own js-files.