Initial commit of formatWord() function.