Extract methods to improve flog score of TopicView

Minor PR to reduce the flog scores of `TopicView#filter_posts_near` and `TopicView#initialize` (most complex methods per [Code Climate](https://codeclimate.com/github/discourse/discourse/TopicView#method-complexity))