open a new connection for each thread
simplify query logic
support async resthandler operation

add RESTRequest to cache http attributes, which get cleared after
on_http_data handling.

allow rest_handler functions to return None, which means they will
call rest_response themselves, at a later time.