Add an ansi parser instead of hacking this with regex. Fixes #4