Use boyer-moore-horspool algorithm for indexOfPos and lastIndexOf unless the haystack or needle is very small