hadoopcompatibility: Added serialization functions for tasks.