Major rewrite
- Rewrite implementation as object
- Rewrite tests to work around nodeunit excessive memory usage
- Add documentation