Server query queue

- Create a query manager object, which encapsulates state about queries and moves a lot of code out of `Server`.
- Add a query queue inside the query manager which only lets one query execute at a time.