add couch:get/2, couch:get/3 to fetch a document.

This change add the couch:get/{2,3} function to fetch a document. It is
supporting all options and offer a simple API to also stream attachments
so it can be used to stream a document.

Example of usage:

(rcouch@127.0.0.1)1> {ok, Db} = couch:open_db("testdb").
{ok,{cdb,<<"testdb">>,
         [{user_ctx,{user_ctx,null,[<<"_admin">>],undefined}}]}}
(rcouch@127.0.0.1)2>
(rcouch@127.0.0.1)2> couch:get(Db,
<<"5f480e40beb20ce551d848a8b5000df7">>).
{ok,{[{<<"_id">>,<<"5f480e40beb20ce551d848a8b5000df7">>},
      {<<"_rev">>,<<"2-6cc0258e6120c8cdff8a3c75930ce542">>},
      {<<"_attachments">>,
       {[{<<"frais_enki.ods">>,
          {[{<<"content_type">>,
             <<"application/vnd.oasis.opendocument.spreadsheet">>},
            {<<"revpos">>,2},
            {<<"digest">>,<<"md5-6DZZHRxjEI8Qr+yTLpjG5g==">>},
            {<<"length">>,30272},
            {<<"stub">>,true}]}}]}}]}}
(rcouch@127.0.0.1)3>
(rcouch@127.0.0.1)3> {ok, {stream, Next}} = couch:get(Db,
<<"5f480e40beb20ce551d848a8b5000df7">>, [{open_revs, all}, stream]).
{ok,{stream,#Fun<couch.4.87847453>}}
(rcouch@127.0.0.1)4> {doc, Doc, Next1} = couch:stream_doc(Next).
{doc,{[{<<"_id">>,<<"5f480e40beb20ce551d848a8b5000df7">>},
       {<<"_rev">>,<<"2-6cc0258e6120c8cdff8a3c75930ce542">>},
       {<<"_attachments">>,
        {[{<<"frais_enki.ods">>,
           {[{<<"content_type">>,
              <<"application/vnd.oasis.opendocument.spreadsheet">>},
             {<<"revpos">>,2},
             {<<"digest">>,<<"md5-6DZZHRxjEI8Qr+yTLpjG5g==">>},
             {<<"length">>,30272},
             {<<"follows">>,true}]}}]}}]},
     #Fun<couch.6.87847453>}
(rcouch@127.0.0.1)5>
(rcouch@127.0.0.1)5>
(rcouch@127.0.0.1)5> {att, Name, AttInfo, Next2} =
couch:stream_doc(Next1).
{att,<<"frais_enki.ods">>,
     [{name,<<"frais_enki.ods">>},
      {att_len,30272},
      {disk_len,30272},
      {type,<<"application/vnd.oasis.opendocument.spreadsheet">>},
      {encoding,identity}],
     #Fun<couch.8.87847453>}
(rcouch@127.0.0.1)6>
(rcouch@127.0.0.1)6> {att_body, Name, Chunk, Next3} =
couch:stream_doc(Next2).
{att_body,<<"frais_enki.ods">>,
          [<<80,75,3,4,20,0,0,8,0,0,88,52,218,68,133,108,57,138,46,
             0,0,0,46,0,0,...>>,
           [<<52,8,206,212,207,125,241,127,65,183,48,80,111,24,98,
              201,116,181,196,118,100,19,198,...>>,
            <<201,73,196,40,144,209,130,188,188,211,115,50,83,211,42,
              42,190,22,60,126,150,236,...>>,
            <<74,89,81,14,76,36,22,19,85,95,12,4,91,52,47,47,72,79,
              168,219,124,...>>,
            <<253,84,21,6,113,151,86,21,15,181,59,71,117,32,89,45,94,
              109,60,36,...>>,
            <<198,71,68,233,8,121,55,205,186,61,196,110,68,199,143,28,
              227,6,210,...>>,
            <<0,0,0,2,0,0,0,0,0,0,0,80,75,3,4,20,0,0,...>>]],
          #Fun<couch.10.87847453>}
(rcouch@127.0.0.1)7>
(rcouch@127.0.0.1)7> {att_eof, Name, Next4} = couch:stream_doc(Next3).
{att_eof,<<"frais_enki.ods">>,#Fun<couch.9.87847453>}
(rcouch@127.0.0.1)8> couch:stream_doc(Next4).
eof