Cleaned up and reorganized code
Added js file for adding modules.