Flag activity on a bucket before finding a vbucket.

This errs on the side of dirty, but is still racy.
Small buffer on the periodically registrar.

Work blocks registration, so if work *causes* registration, or
peripheral work holds a lock that that something doing background work
wants a lock held by something wanting to register causes a
mini-deadlock.

Really, a buffer size of one *should* be enough to prevent this from
happening because unrelated things should work themselves out, but
more won't hurt.  It's also possible that the right combination of
concurrent jobs could do something similar, but a given periodic
dispatcher should only be running one type of job once at a time per
unit of registration (e.g. storage backend) which should generally not
be competing for the same locks.

I do need some more verification that this doesn't leave any data
unwritten, but I'm going to call this issue closed for now.

cbugg: close bug-509
Disable periodically control buffering for tests.

In real code, we don't care if timing is slightly off.  In tests, we
want to see that the eventual effect is correct.
Slight features.md tweaks.
Mention of ddoc U/I in features.md list.
Prevent duplicate http header writes on streaming results.

cbugg: close bug-533
Renamed flush-and-compact to persist.
TODO note on immediate persistence.
Parametrized store filename suffix.

This allows easier future reuse of the store layer, since it has
useful, periodic flushing, compaction and passivation features.
Refactor copyBucketStoreDeltas().

A callback approach allows copyBucketStoreDeltas() to be simplified
and the calling code to read more straightforward.
Not using buffered channel for rest couch.
DDoc struct.
Use cbgb.DDoc struct.
Get/SetDDocs().
Coverage: zeroate.
Added array prefixing test.
Use pre-parsed design doc.
Track staleness for periodic view refreshing.

This follows the same "periodic worker pool" approach used for
dirtiness tracking and persistence.
TestStaleness().
Refactoring auth to be contained in BucketSettings

Also wrote some tests.