update error reporting, lint
add callback support
add lib decode
add new tests
update npm test