Fixes for incremental search feature

- Since 1.9 strings are unicode aware, we can't treat them as arrays of
  bytes anymore. Now we take advantage of String#byteslice and
  String#bytesize to do our dirty work.