Cleaning and rewriting more

gui.py is now a class, removed dependency between gui and core, minified
code by replacing res with slicing. And more. Main.py not needed and not
useful anymore.