Coffeescript support

Copied from #31, which has some other changes.