Coding style

During the search for an converter from ansi colors to html I found your project and [started to implement](https://github.com/ypid/aha/tree/latex-support) it. But then I realized that doing it in Python based on [ansi2html](https://github.com/ypid/ansi2html/tree/ansi2latex) was a little bit easier. Still, here are some optimizations.