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

Sure - I was actually thinking of an `Err() error` in addition to other methods but didn't spell it out (see how some of the net funcs deal with things like this. What you suggest works; then if you get `Early() == true` you check `Err()`.