Added hosts functionality, added tests, removed unused code.