Added process-level heartbeats, unit tests, and some bug fixes