A lot of refactoring around the reuse of machine event processing. Added the ability to add power off codes and power off events.