Bug/subgroup proposals

This patch fixes [this bug](https://trello.com/c/7pcpbxQN). I've refactored queries from the `Discussion` model into a new `DiscussionsQuery` class using the [Extract Method](https://gist.github.com/4346010) pattern.

There are still a few more queries which need to eventually make their way into the new `DiscussionsQuery` class.