Refactor couch_db:get_doc_info/2 to support _local/ documents

COUCHDB-1145
Use namespace argument to select correct tree for the enum_docs request

COUCHDB-1145
Test for number of att copies after compaction

Compactor copies same attachment multiple times. This happens in the
case when two docs upload the same attachment. Hence we write a test
before implementing a fix for the problem.

BugzID: 26566

COUCHDB-2516
Pass dict around to store already processed atts

BugzID: 26566

COUCHDB-2516
Convert map to mapfoldl so we can use Dict passed

BugzID: 26566

COUCHDB-2516
Fix the issue by introducing maybe_copy_att_data

BugzID: 26566

COUCHDB-2516
Extract read_doc_with_atts function

BugzID: 26566

COUCHDB-2516
Use `if` instead of `case` in read_doc_with_atts/2

BugzID: 26566

COUCHDB-2516
Rename Dict to ProcAcc

COUCHDB-2516
Change mapfoldr to mapfoldl

COUCHDB-2516
rename D -> GlobalProcessed

COUCHDB-2516
Make state used by add_sizes_acc more opaque for the caller

COUCHDB-2516
Refactor add_sizes to return #size_info records

COUCHDB-2516
Return New flag back to copy_docs when attachment is new (not shared)

COUCHDB-2516
Fix calculation of active size for case of sharing att

COUCHDB-2516
Improve test case

COUCHDB-2516
Add test case for delete_doc with shared att

COUCHDB-2516
Fix compilation warnings

COUCHDB-2516
Increase att size in test case

COUCHDB-2516
Add should_calcualte_active_size_on_doc_update test case

COUCHDB-2516