Previous change to support custom classes broke pager clicks.

@spmason

This got a bit fiddly - the click event was bound before the class might be changed by the consuming code. So, it seemed easiest to check the target in the handler itself.

This left a problem with .off()ing the handler, so I used a namespace for the click handlers.

Let me know what you think.