Make HasTraits pickleable

The main change is storing method names instead of functions in `_trait_dyn_inits`. These functions were failing to pickle.