fix bug 1033328: Class based filtering with jquery selectors now working

Also fixes bug 1033330 and bug 1043783 as they were related to the work for this perf improvement.
The speed improvements here may not be quite as fast as TBPL, but they should be at an acceptable level.
This changes our filtering mechanism to use JQuery selectors to set jobs, groups and platforms vislble or not.
This also contains some refactoring to make some functions more reusable and prevent circular references in our classes.