Refactor templated binary search to match common implementations and not keep midpoint as lower bound unnecessarily.