Move javascript into separate file

Also load pages all in one go and use anchors to go to each page