Refactor topics controller and model

Refactor: 1) TopicsController to reduce code climate complexity.
2) Topic model,  group class_methods together using class
<< self