Add tests for the AsynchronousDnsResolver and fix some minor bugs