Improve tests for EC2Client and QueryClient.

Also drop a fair bit of unused code.