Code for cleaning up training and test data.