Add callbacks into the tokenizer and serializer

So its possible to filter and transform the output