Remove reload parameter during history handling

The regex is kind of complex here, so please take a close look.
From an API standpoint, this should probably be `removeParameters` (or we should change to `appendParameter`).