Refactor and Building releases

- Refactored all javascript and decoupled it in components.
- Added dist target to Gruntfile