Multipart/related handling improvements

Implements the changes proposed in [Jira 1956](https://issues.apache.org/jira/browse/COUCHDB-1956) to allow chunked encoding of multipart/related requests and make attachment lengths optional. Also addresses [Jira 1685](https://issues.apache.org/jira/browse/COUCHDB-1685) to allow POSTing of multipart/related requests. The code for the latter was in [Pull Request 91](https://github.com/apache/couchdb/pull/91) but that ran into build problems so I will close that PR.

I'd be very grateful if members of the group could give the code a thorough review if you have time. To help out with that I will attach some review notes to the [Jira ticket](https://issues.apache.org/jira/browse/COUCHDB-1956) to give an overview of the changes.