Started on a road for some refactoring

Probably won't follow this road if what I try works...
Initial support for terminal with 256 colors