Added serialization (saves game when world is closed)