Split token regex into it's own method.
Add an error method.
Emit an 'error' event when from the error handler.