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

errors in errors.go use prefix optimize, here it is opt. Should be unified? Which is preferred?