Add a preference for running on battery

This adds a preference for whether the app should run while the device is
running on battery. Checks are performed when starting the miner and when
the device's power state changes.