Correctly store data-url and correctly select for it

This also removes any lingering references to ```subPageUrlKey``` from the code.

Fixes gh-1383
Minor point, but why not use window[0].decodeURIComponent here like you do elsewhere?