updated to coffee-script, refactored things