Implemented Course.enroll with atomic checks for course free spots and available groups.