Move sr_parser::parser_state to sr_parser::state.

This change also better encapsulates the class.