Fixes autocomplete feature.

- Switched grammar impl to switch state using singleton objects instead
  of pulling methods off the module and sticking them on main grammar
  object.  Attaching unbounded methods to a type other then the type
  they originated on raises an error.