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

Weird... this isn't a tab on my computer.