add mocha tests
add coffeescript support & refactor