Functionally complete on existing hardware

Added in low battery and charging functionality and generally cleaned up
structure.