Fix Clang problems. Fix test build on Linux. Update Clang status.

I'm not sure whether the Clang issues are Clang's fault or mine.
In summary:
declaring state_reference class outside the scope of the ctor fixes
erroneous references to the state.
iterator to mapped type from operator[] doesn't update the mapped value.