Coffeescript rewrite

WIP

- Convert all js to coffeescript