Minor comment change.
Small fix to test case -- bug caught by Visual Studio code analyzer.
Reorganized State source to expose the StateImpl class to facilitate inlining of frequently-called state access methods.