Why do we need "GalacticOptim.instantiate_function"?

It builds the closures required for the calls to exist without the p parameters as part of it, which is required by many of the optimizers. We should probably turn that into callable structs though to help with type inference.