fix bulk_get responsw for couchbase lite frameworks.

This change fix the bulk_get response so it can be used by couchbase lite
framworks to improve the replication.
fix pattern matching issue
fix response of atts_to_mp.
json is also in related part if attachments
fix multipart: make sure to jump split between related and main mp
fix mp response
fix
don't add a line after the json body.
fix typo
fix order and eof
foldr/foldl