fetching document via REST returns entire document structure when envelope=true
properly parse query string
Merge pull request #248 from tedsuo/master

fetching document via REST returns entire document structure when envelope=true