Dashboard refactoring for rolling certificates

* Dashboard view refactored to prevent database accesses for
  non-validated user accounts.
* Studio advanced setting added, "certificates_show_before_end", which
  determines whether a course should permit certificates to be
  downloadable by students before the course's end date has passed.
* Modifications to dashboard view and templates to allow display of
  certificate download links before courses have ended, while being
  careful not to declare failing students as failing before the course
  has ended.
* To test, turn the setting on in a course which hasn't ended yet, and force
  certificate generation for a student, then check their dashboard.
* TODO:
  - needs tests
  - needs pep8/pylint