Preserve page titles when pushing/replacing state

Fixes #942
Fixes #1148
Merge pull request #1166 from OpenTreeMap/fix/942/preserve-title-when-using-history-api

Preserve page titles when pushing/replacing state