pools: initial implementation of pool state machines.

moved enable_pool(), disable_pool() and other functions related to
state. These could probably be factored out altogether.

Pool state default is now "enabled" - it was previosly "disabled",
but there was an unconditional function call to enable all pools
in main() previously. It was factored out by joe's earlier commits,
so not visible in this one.