Stand alone usage

Tests

The tests have been ported to run using nodeunit. This was the easiest way to confirm
the new node.js library works as expected. Some new tests have been added to cover
edge cases, and others not relevant in the new environment have been removed.