Moved js file and added improvments

- converted underscores to camelcase
- rearranged code in JS file to actually make sense
- Jasmine tests!