WIP: add criticalBatteryShutdownLevel; fix plugged/charging status

This does two things:

 * adds a criticalBatteryShutdownLevel config value so device
   maintainers can choose a battery level to force shutdown
   instead of relying on the hardcoded 0% shutdown

 * change interpretation of "isPluggedIn/isPowered" to mean "isCharging"
   Note that some devices can draw more than 500mA,
   so "plugged" != "charging" (as is assumed in existing code).
   This faulty assumption can result in incorrect charging status
   reported and inability to shutdown at critical battery level.

Testing/feedback please!

Change-Id: I6b3282df6513a8c235b0f4cdfd9e16f531e34166