Issue #13 Grammar memory usage

Refactor the grammar to reduce its memory footprint.  Decreases max
usage by about 300KiB and the final grammar size by ~50KiB