Refactored case-conversion functions.

StrToLower() returns a modified copy of the string, InPlaceLowercase() modifies the string in-place.