Switched str manipulation functions to use mbstring