Refactor the system action code

This patch reduces some of the copy/paste code in all the system
actions of the manager. It also fills in the logging events for
the suspend and hibernate types.