Whole load of additions and bug fixes

Fixed datatables default sorting.
Fixed cumulative sorting bug.
Added hostname to metadata on client side.
Fixed SQL params for postgres dbs.
Removed some prints from client side code.
Fixed filtering bugs and improved persistence between pages (may need some further testing).
Fixed date filtering for line graph.

See individual commits for further details.