Fully working serialization for saving and loading.