More closely override Cmd.onecmd

- onecmd should be an object method, not a class method.
- call default() if we can't find a suitable do_ function.
- call emptyline() if there is nothing to do.
Example function fix to use string calling convention.
Fix excessive indentation.
Use simpler recursion. Implement lastcmd behaviour from parent class.