Refactor inference not to use exceptions.

@shekari @stamourv @takikawa

This is now done (modulo any more comments).  All tests pass, and the full system builds (with and without contracts on). 

Speedup is about 1 sec on `racket -l math/scribblings/math.scrbl`, from 17.4 seconds (on my fast machine) to 16.3 or so.

Still todo:

- [x] Pass all tests
- [x] Better commit message
- [x] More timing
- [x] Any remaining review comments