Revised sleep code

This commit includes slightly revised sleep code.  The old sleep code
attempts to disables BOD before sleeping regardless of the sleep mode.
But BOD can only be disabled before certain sleep modes; attempting to
disable BOD before other sleep modes (presumably) has no effect.

To play it safe, I revised sleep code such that it only attempts to
disable BOD before entering the power-save sleep mode--the only mode
where BOD should be disabled to save power.

A couple of other changes in this commit just make the code clearer
and easier to read.
Alarm during sleep and non-beep alarm bugfix

This firmware allows the alarm to sound, even while on battery power.
But if the alarm sound was set to the three-beep pulse or one of the
musical alarms, the alarms would not sound when external power was
lost.  This has been fixed.
Source code comment edit

The initial comments in several files have been revised.