Prepare controller for sleep
Add ability to have the controller sleep when no work is pending.

Wakeup is automatic upon scheduled task or reception of a MIB message
Fix formatting bug in rpc error handler
Add support for sleeping controller