Refactoring tests and base58 encoding