Add method serialization.to_file and use it to improve PickeableObject and JsoneableObject write methods