Add a few comments, remove any waitlist entries when removing enrollment...

..., and change the logic for checking if a user is already enrolled in a course.