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

I don't really understand why this is necessary or lastProvided status or the check in the init() below. You can get all the behaviour you implement here (with exception of the panic) just with reference to len(statuses).