[utility] Add bisect function

* Fixes some problems with the dichotomy function, I believe it to be quicker too.