Add temporal locking support, through shared State.
Add State type casting utility class.
(Both provided by Rick, thanks!)