Rename generateFunction to generate_function.

I think this is more consistent with naming conventions.