adding nested query capability
Merge branch 'master' into NestedQuery
Improved upon diwu's work on nested queries.

Did some cleanups and added more thorough testing.
Updated Changelog.