Tables: Fixed sorting and setting overrides to be compatible with DataTables 1.10 (fixes #5388 and #5389)

As part of this, added a couple compare functions to helpers.js, rather than keeping to just tables.js, for use later on by other plugins (or by implementers in custom code).