JS - Fixed bugs occurring when deleting courses; cleaned up various
code.