Turn these lambdas into functions; allows them to be pickled.

I'm saving references to nonlinearity functions in my object which I want to be able to pickle.  This small change makes that possible.