Some refactoring, added i/o handler an a command parser, none of them are really implemented atm.