Move console internals out of main.cpp