refactor of command line parser, add resolve host, add tests