More refactoring; basic serial console