Move script to own js file and include jquery

Use jquery to load three.js as a dependency