Added serialization and deserialization for Word, and also corresponding tests