Made thread-safe by moving session and response_handlers onto the
request object.