Make more use of DefineConsoleMethod

Resubmission of #887 with some fixes.
```relativeFileName``` is optional we need to add to default args as ```("")```