Refactor format_array in pandas\io\formats\format.py
see https://github.com/pandas-dev/pandas/pull/26833#issuecomment-501838802

to make `format_array` more generic we need to push more functionality to the objects to be formatted themselves (and PandasArray) rather than encoding the conversions and special casing in `format_array`.