Merge pull request #1252 from sgrenier/next

Overhaul to how UI focus and state changes are handled
Slight change/simplification to the interface used by ControlFactory.cpp
Added back some code that accidentally got removed from a bad merge on a previous commit.