Refactor the lexer to separate the core parts and the Mb-specific parts.