changed default host from localhost to 127.0.0.1
refactored some stuff, get test running