Fix a variable shadowing bug in core.managers

Apparently, list comprehensions don't introduce a new scope; this caused
one 'topic' variable to be unexpectedly mutated.
Add view and template code for a lesson's topics