First pass at battery monitoring code.