Refactored grammar construction
Moved grammar top-level as it is no longer just a part of the SLR parser (closes #19)