Make controller sleep when not doing anything else

Controller now sleeps when the following two conditions are met:
- no tasks in the taskloop
- no rpc master call currently in progress

The flash memory is disabled in sleep to save power.  It is automatically reenabled upon first use by the memory module and there is a wait-state incorporated before the first write to the flash since it needs at least 10 ms to warm up and allow writing.  All flash memory writes now wait until they complete before returning so that we cannot sleep (and disable the memory) while the flash memory was programming itself.

Also made the controller reset the MIB bus whenever it resets so that all modules reregister themselves. This means the controller will always have a correct picture of which modules are on the bus.

Closes #49, #22