update example.js
cleanup: rename createError to createErr
cleanup: add istanbul ignore
add isOk and isError
updated the README with better example & docs