L2P: switch over rule chars in next_match

This changes the structure of `next_match` such that the outer
switch is over rule characters and the inner switch is over states.
For this change, the rule characters are always empty, so it will
always match the null case.

This restructuring makes `next_match` compatible with `match_l2p_rule`,
allowing the two functions to be merged, which then allows look-ahead
matching rules.