added mailer for when a student submits to an assignment

Rather than fabricating these enrollments, you can just say:

    course.users << [student, instructor]