History: Simplify checkboxes script on History pages

This should reduce the amount of variables constructed and also switches
to a class based implementation, which allows us to do the same with
fewer calls touching the DOM.

Not supported by IE6.

Bug: 51561
Change-Id: I4596b3667f990ef1d8c7ca753e1d80fe285d5614