bip39 implementation with unit tests