[Bugfix] Revert "Component Grader only overwritten if changes are made 
[Bugfix] Revert "Component Grader only overwritten if changes are made 

* Revert "Revert "Component Grader only overwritten if changes are made (#2839)""

This reverts commit b4f2eb35ecaf40cc842197f1a85008f5f7dcf976.

* Added undefined checks for graded component equality

* Improved undefined check

RCOS-Grading-Server/HWserver,RCOS-Grading-Server/HWserver,RCOS-Grading-Server/HWserver,RCOS-Grading-Server/HWserver,Submitty/Submitty,Submitty/Submitty,Submitty/Submitty,RCOS-Grading-Server/HWserver,Submitty/Submitty,RCOS-Grading-Server/HWserver,Submitty/Submitty,Submitty/Submitty,Submitty/Submitty,Submitty/Submitty,Submitty/Submitty,RCOS-Grading-Server/HWserver,RCOS-Grading-Server/HWserver,RCOS-Grading-Server/HWserver