moved rsearch and rsplit to internal methods. fixed for utf8.