Refactored cache to support optional document revisions

After some hunting and subsequent extinguishing of a cache eviction bug, this new code seems to work. Reviewers should specifically look at the use of `ets_lru:match`. Depending on how often it's called it might be wise to avoid the current gen_server call that it costs and create a match_d version. The other focus should be the new revision api `ddoc_cache:open_doc/3`.

I'll leave this for review while I finish testing the changes required to start using this in certain places to avoid doc chatter over the wire. In the mean time, please tear this apart as I'm sure it could be improved.