restructure heartbeat to append_entries; create submodules