refactor and export get_address_type()

I refactored the base58 check into get_address_type() so the code can be used for any type of crypto currency that follows the same base58 address scheme as bitcoin does, e.g. litecoin, feathercoin, namecoin etc. Not sure if you care about this PR or not, but feel free to grab it if you do :)