Re-added heartbeat code, and added redis storage for heartbeat data