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

Is there anything that can be done about this loop? That's a LOT of breaks and makes the flow control really wonky. Maybe replace it with an unexported function call?