Fix cache helper test.

Previously disguised as "ApplicationTest" in "models".
PostTagHistory has been replaced by History.
Fix code styling.
Fix test for pool controller

- add js support for `access_denied`
- pool operations now require login
- append redirect url to login redirect expectation
- fix up deprecated queries
- sequence is now a string
Fix most(?) of deprecations in PoolController.

- add wrapper for sql generator thingy to match new rails
- fix old query syntax
Count for https instead of just http.

Avoid generating link text starting with "/".