Fixed incorrect subclass pickling test.
Added pickling test and support for undefined slot attributes.