Common: Simplify uppercase/lowercase string functions.

Also changed it to not modify the given string, but rather return a copy of it.