Added writeTerm to MathicIO and now test both readTerm and writeTerm.