Call HookBeforePut before updating memcache

If memcache did not have an entity but datastore did, we refresh the
version in memcache.  Before doing that, we must be certain to call
HookBeforePut to make sure that memcache accurately represents the
entity.
Add HookAfterGet hook

Each entity must define a method which is called just after it's fetched
from the datastore (or memcache).  This can be used for setting default
values or calculating private fields based on public ones.