restructurized code
added other nio_* functions to the console class