Use getURL() in HistoryLocation

When trying to subclass HistoryLocation, it's hard to override certain
methods, because they don't use public API of this class for getting
URL. This patch changes all calls to location.pathname into getURL()
calls.
Allow to override router's handleURL
Merge pull request #1845 from drogus/be-consistent-in-history-location

Small improvement in HistoryLocation: Use getURL()