Fix case sensitivity issues

endswith, startswith, indexof, lastindexof all were case-sensitive...
which is bad.