Moving grammar to global scope

This addresses bug #33 as mentioned in the comments.