Implement RewriteMap expansions a little more thoroughly.