Use enumeration for return values

Also improve debug statements.
The changes were made to verify memory management.
Add test for low memory behavior
Stabilize commit-stats as a test case

- Add time to date, as otherwise it seems to use current time.
- Use author's timezone, so as to make it independent of the
  timezone currently in effect.
Specify input/output files through -i/-o options

This allows the specification to sgsh-tee of multiple input files
in a constent manner.

Currently input files are read sequentially and only the current one
is buffered.

As part of the changes to the sgsh-tee invocation, debug monitoring
now happens using tee(1), rather than sgsh-tee(1), in order to achieve
tighter (better synchronized) monitoring.