Changed state switching code to be part of the RT system, not of the RT
object.
Changed the implementation to add basic for supporting entity-based
state changes.
Removed object-based state changes.
Improved entity-based state change code.