Added console support and file output routines.