Requre JS

- Improved the javascript libraries to use the AMD pattern design
- Changed a few things to properly work with the new AMD pattern