Allow ClassMetadata to invoke lifecycle callbacks on proxies (fixes #763)