Support the $bucket/ddoc path
Add enhanced stats support

This adds additional support for non-default stats, as well
as implementing the special __MOCK__ stat. It is intended
that other mock implementations should implement this
(perhaps along with a supported featureset) so that test
code can check at runtime whether the server is a mock
or not.