Big mess in grader.js trying to deal with asynchronous write (even though I used Sync).