Sets up ajax pagination, plus some small tweaks

This sets up ajax pagination only for the "jump to page" part of the pagination widget.
Let's clean up the syntax in this borrowed JS.

```js
for (var i = 0; i < vars.length; i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
        return pair[1];
    }
}

return false;
```