wait until the DOM is loaded

The Courseware view isn't initialised before the DOM is fully loaded.
This probably fixes #265.