Move Grammar class to new module