Cleanup of heartbeat handling and status printing. Ready to go mainline