fix: imports, API changes, and baked-in course ids

The 'index' view still contains baked-in course ids - will fix this
later ideally by getting rid of 'index' and using the instructor API
instead which mostly does the same thing.
add course_id arg and csv output filename option

Massive code clean-up as well.
add course_id arg and dry run and csv file options

Massive code clean-up as well.
cleanup get_assignments_attempted_and_failed
randomize_module: pep8 cleanup
randomize_module: add support for history tracking

History tracking enables never selecting the same child twice. Currently
this functionality is tied to the randomize xmodule's use_randrange
attribute.

TODO: Add new xml attribute `no_repeats` to toggle history tracking