added test and implementation for case insensitive word replacement