Added a write method for the Corpus, and a unit test for the same