refactor and export get_address_type()

also updated the API in README