Turning the serialisation into its own class

NOTE: Not working yet.