Make `@deprecated` decorator work for classes.
Fix pickling issues with class deprecation.  Fix Python 2.6 bug.
Merge pull request #2156 from mdboom/misc/deprecating-classes

Make `@deprecated` decorator work for classes.