Initial commit of functions from github.com/btracey/optimize

Ah, I forgot properties of variables could be constant. Thanks.