Changed module system to be dynamically loaded javascript using Mozilla Rhino