Cleanup grader

Clean up the GradingPreprocessor code and add tests