Refactor rule parsing.

 * It respect RFF4, and especially backslashes escaping.
 * It is more concise than before.
 * It is more extensible.
 * It is more clear.