Added connection and request parameters to extractObject, and checked if...

... it had sent a response before continuing (PLAT-673)

Sample use (from platform):


    // Verify that the given subject is indeed present in the behaviour domain
    auto verifySubject = [=] (const RestServiceEndpoint::ConnectionId & connection,
                              const RestRequest & request,
                              RestRequestParsingContext & context)
        {
            // Grab the dataset
            Dataset & dataset = context.getObjectAs<Dataset>();
            
            // Find the subject we just parsed from the path
            string subject = context.resources.back();

            //cerr << "subject = " << subject << endl;

            SH sh = SH::fromString(subject);

            bool exists = dataset.behs->knownSubject(sh);

            if (!exists && request.verb != "PUT") {
                Json::Value error;
                error["error"] = "subject '" + subject + "' doesn't exist in dataset";
                connection.sendResponse(404, error);
            }
        };

    auto & subject
        = subjects.addSubRouter(Rx("/([^/]*)", "/<subject>"),
                                "operations on an individual subject",
                                verifySubject);