Changes to improve performance when filtering.
Use new backend code for much better efficiency

I changed the backend code so we can limit the data set returned. If
tomcat had been running for a long time and you requested all data from
-1 it could return a massive amount, which would then be turned into
elements and promptly deleted later when the max rows value is
exceeded, instead I now send it the amount we want to view anyway.

Also made selecting elements more efficient by using setting type as
class name for boxes rather than looking through their data to find
their type.