aggressively cache LazyAttachmentDoc attachments

both in local memory and in memcached
(and carefully invalidate the cache)

in the case of commcare hq's app builder (currently the only client of this code),
this saves the web worker from fetching the same attachment many times in the same request
and from fetching the same attachment between requests when it hasn't changed
I guess it's not likely that content would be an empty string or any other non-None value that evaluates to false? Would be a *little* more conservative to do `if content is None`. I think not worth changing.