Add unit tests for tokenize function