refactored context generating functions into grammar config module

I often find myself copy/pasting code similar to that in multiedit to disable grammars in certain contexts.  This PR exposes this functionality via grammar config files.

There was discussion in the git grammar PR about making contexts configurable.  Maybe that configuration belongs in the grammar config files similar to how this PR works??