added serialisation tests and finished serialisation to string