(#509) add pouch error code back in
Merge pull request #582 from daleharvey/509-error-method

(#509) add pouch error code back in
(#576) - move common logic into generic adapter

common logic:
* revs
* revs_info
* conflicts
(#576) - move get related tests to test.get.js
(#576) - replace ok with strictEquals

Whenever it's possible we should use strictEquals as it gives more
feedback.
(#576) - revs returned too much history

When revs=true and rev != winning couch does not return the full branch
but only revisions older that rev.
(#576) - add test for open_revs != "all"
(#576) - open_revs now reports when gets wrong params

If it does not get array or some of the revisions does not start
with "number-" it reports error.

Test attached
(#576) - get with revs_info should display only winning branch

Fixed this + test added
(#576) - revs_info returns correct status

Revs_info should return status available or missing (when document
got compacted). This commit implements it with tests.
(#576) - cleanup

* typos
* jshint
* comment one tests as #583 has appeared
(#576) - fix collectConflicts and add test

CollectConflicts was broken and as get has now conflict test it
now fixed and tested.
Merge pull request #584 from neojski/576-cleanup-get

(#576) - cleanup get
Merge pull request #580 from howonlee/master

(#552) rudimentary app testing, took more localstorage out
(#587) - add test for open_revs with nonexistent docs
(#587) - fix open_revs for nonexistent doc

By the way: we don't need to fire getRevisionTree if open_revs="all"
so now we don't do it.
Update docs for new async pouch creation
Merge pull request #588 from neojski/587-open_revs-nonexistent-doc

587 open revs nonexistent doc
Merge pull request #590 from benrudolph/async-docs-update

Update docs for new async pouch creation
(#583) - compact callback after compaction's done

Now http adapter behaves like others. The code manually pings
database to check if it's done compaction.