Attach generated implementation classes (weakly) to schema objects, instead of using a global cache.

This is done to avoid having to go through another cache and acquire a lock every time we need to instantiate a managed type.
This does make unit testing slightly more inconvenient in that a singleton schema store has to be used for all tests, but I deemed this an acceptable trade off.

+review REVIEW-5329