Better URL escaping. Allow for disabling pushstate