refactored wallet objects and fixed master key #21