consolidate-repos: improve sed expressions and a bit of cleanup