Refactor towards multi-sample support

@jglidden This also cleans up some of the query tests, in particular using context managers when starting servers. What do you think of the `loom.query.get_server` helper? I'd like to eventually start servers with `root` variables.
I've been trying to consistently order imports from most general to most specific