factor some code into the Rule object

lib/compile.js - map raw objects to Rule objects
lib/generate.js - use ternary if for serializing, add parser.body to
generated code
lib/nearley.js - new Rule now creates Rule objects, have Rule to
serialization of the rule part of an Earley item (State), Parser object
maps raw grammer objects to rules