Refactor to create per-command functions; full support for -n, -t, -s