Make commands.Query.compact tail-recursive
Merge pull request #2505 from boggle/compact-query

Make commands.Query.compact tail-recursive