Pickle and Unpickle theano functions

Added a test case to verify if pickle and unpickle a compiled theano function works.
Passed.

This is the follow up of gh-1945
Ah, ok.  The name confused me and I assumed the attributes where removed on self.  I don't think it's especially ugly, but it might use a better name.