Work on query() and resolve() mostly to facilitate returning future/set_result

IPv6 support neds work...