Refactor a load of duplicated code in mon-power.c.  Patch mostly by daniel.santos.  Closes #1706.