Resolve issues with start/stop cycle

This refactors the start/stop cycle in the application to move the majority
of the logic out of the Activity and into the application class. This
resolve several issues with the start/stop cycle and widget status updates:
 - The application now stops when "Run on Battery" is unchecked, the miner
   is left running on the home screen, and the power cable is removed.
 - Resolved issue with widget always being in "Stopped" state immediately
   after returning from the app to the home screen.
 - Resolved issues with stopping the app when exiting and re-opening the
   app during a run.