cleanup Util, and add 'ensureSingleItem' method
refactor Util.groovyReplace into generic embedded replacement