Coffeescript rewrite

Issue #19 is addressed here :)