Replacing all the code to use THREE.JS for easy reading and maintenance.
Newer version created.
Included THREE.js.