Use weakrefs to hold onto classes #2521.

This also causes the _weakref module to be built into the core.
4 files changed