Convert pushstate to js

Although this is readable enough, it probably makes sense to update it to match what I suggested in `_supportsHistory` for consistency.