os: reimplement HasPrefix and LastIndex to not depend on strings
os: reimplement HasPrefix and LastIndex to not depend on strings

R=golang-codereviews, rsc
CC=golang-codereviews, jas
https://codereview.appspot.com/44790043

apparentlymart/golang,apparentlymart/golang,apparentlymart/golang,apparentlymart/golang,apparentlymart/golang,apparentlymart/golang,apparentlymart/golang