Added a weakref proxy implementation that works with both normal functions and instance methods.
Fix unit test for setting attributes in derived classes to run properly on Python 3.3.