Started some refactoring

Now used Google CDN for three.js
Put javascript code into a separate .js file