Finished refactoring Engine for use with SmartIO module.  Code compiles but will not work.  Awaiting further refactor on Monday