Better support for custom tokenization rules (phase 2)