Add tags to topics

There is quite a bit of tagging-related code in models.py now; it may be
a good idea to do some refactoring in the future.