Make state be a class outside of sr_parser's scope.

This is in preparation for adding legality checking to transitions during
parsing.