Use error-m monad for core game transitions

Change the next-phase, next-step and tick functions to use m-chain, so
all of the prep-phase, post-phase functions can return failures.

First use is to enforce max power-plants in post-phase for phase2. This
prevents the phase from incrementing when player has too many power
plants at the end of the phase.