Make more use of DefineConsoleMethod

Resubmission of #887 with some fixes.
Better to use a var with size of buffer, no?