Beginning architecture change for adaptability to a variable number of modes, not limited to 3.
Also trying to remove certain robustness issues. Keeping older versions for 2 and 3 modes for easy access during code refactoring before deletion.
Authored by: ssix 2013-09-20
Parent: [r25919]
Child: [r25921]