clean up Qgis2threejs.js (refactoring)