Several refractorings. More tests. Request prettytable