Moving to using Packages in JS
Cleaned and refactored some code
Merge branch 'jsapi'