Added some unit tests for search and replace.