Fix and consolidate option -e, -l, and -w

In the current implementation it was confusion when and when not the
prefix PRE (option -e) was prepended to the log filename (Besides the
problem that the current logic was broken).

Now, the option -e is only for the dumpfile anymore. Moreover, the
option -l and -w are consolidated. Option -w has now an optional
argument for the filename.