Improve performance on Ruby 1.9

Parser makes use of `Array#bsearch` if available to optimize a critical
bit of logic. `Array#bsearch` was introduced in Ruby 2.0, so we need to
backport it to optimize the performance on Ruby 1.9.