Simplify and cleanup code/structure/IO

Rearranged some code and added the RegistryCleaner task that runs on the SERVER_STATE_TIMEOUT interval to clean out servers that haven't sent heartbeat