Preserve anchors and params in link cleanup

[Fixes https://www.pivotaltracker.com/story/show/61037964]