refactored Base58 algorithms into functions; categories are made optional