Log everything that is written to STDOUT or STDERR in the logs directory

One timestamped file and one named "_latest.log" are created. Also, log exceptions in _exceptions.log in addition to the output log files.

This should make reporting bugs easier and more helpful.