Corrected the exception handling on Tokenizer.tokenize.
Added a tokenizer callback handler unit test which also checks for the
correct data types between py2/py3.