use logging instead of print; add tests; fix ip-fallback for arg parser