added wallet serialization and some tests