House cleaning
Refactored everything to javascript from coffee-script