Shell.rewrite -> Shell.expand

This is more consistent with macro terminology.