Completed HostfilePersistor with tests