Add full type support for Query and EC2.

Closes #20.