Generic identifier to numeric ID conversion

Added function and supporting types to gather all rule names into an ID table mapping names to ID numbers and rewrite AST nodes to refer to rule numbers instead of rule name strings.

Signed-off-by: Collin Baker <chbaker0@gmail.com>