Move recursive search-replace function to Utils and add unit tests