Implement serial logging. Finish modularizing power management.