Add tests

Using mocha
Add support for synchronous node functions, fixes #2