Add log file feature and other fixes

- With -l command the logger output is splitted in two channel, one is
directed to the stdout and the other to a SimpleFileChannel, writing to
a log file.
- Fixed hpf_delete
- Minor fixes