Further abstract out the javascript
Ajax remove item from history: a first version