Factory Pattern Implementation

Implemented Factory Method Pattern for online/offline resolution.

Controller no longer needs knowledge of online or offline mode.  This
decision is delegated to the ModeFactory class.