Refactor topic_query.rb for better readability

- Available options are defined and validated
- Internal methods are now protected
- Renamed some variables to be more consistent
Merge pull request #1207 from stephankaag/refactor_topic_query

Refactor topic_query.rb for better readability