Support for GROUP BY and ORDER BY for queries

Also, added support for ORDER BY in collections.
Close connection in test cases to avoid running out of connections
Close connection in test cases to avoid running out of connections
Test coverage for GROUP BY and ORDER BY
Small cleanup of `use` statements
Merge branch 'test-close-connection'

* test-close-connection:
  Close connection in test cases to avoid running out of connections
Merge branch 'group-order-by'

* group-order-by:
  Small cleanup of `use` statements
  Test coverage for GROUP BY and ORDER BY
  Close connection in test cases to avoid running out of connections
  Support for GROUP BY and ORDER BY for queries