More grammar building and other stuff...

No testing, but added quite a few new features including a mini scanner
for the grammar and other things.