fixed the string modification function and added support for a titlecase method

Benjamin Mako Hill || Want to submit a patch?