Hint factory fix test

Numerous fixes to hint factory:
- state data now part of message structure, not json encoded string
- better error codes
- unit tests
- tutor bug fixes
- allow MDP to loop around to problem node