Finished implementing tokenization with error handling.
Also created the tokenizer factory which can be expanded later on.