migrating code out of outline.html and units.html to course.py