Move javascript out to its own file