changing how heartbeats work, now part of the server. Makes more sense with regard to the organization of the code. Also fixing a bug in observer when an event gets dispatched with no listeners.