SPA: move spa.js to the worker directory
Improve seperation of import
Fix jshint error