Rewrite IO.ANSI tests to match new behavior
Bring back original tests for IO.ANSI

To avoid conflict and preserve compatibilty, the new tests use the
functions `IO.ANSI.format/2` and `IO.ANSI.format_fragment/2`.
Change IO.ANSI tests to assume chardata is returned
Implement IO.ANSI format/2 and format_fragment/2
Put IO.ANSI.reset inside a list before concat'ing
Add docs to format/2 and format_fragment/2
Add test case for nested improper lists
Reimplement IO.ANSI do_format

This avoids copying partial lists, and handles nested improper lists.
Fix IO.ANSI doctests
Merge pull request #2562 from thmzlt/ansi

Implement IO.ANSI format/2 and format_fragment/2