enable testing for logging

In order to allow for testing later,
provide hooks for handing over a custom (network,address) pair
and use the semantic equivalent of syslog.New(...)
which is syslog.Dial("", "", ...)
Fix lock test to use formatting

In order to actually display the content of the variables referenced in
the formatting string, use the fooF variants of formatters.
Pass error code along
Split out flags

Put flag handling into extra file
Extract errors from main

In order to manage errors by type and simplify main,
extract common error cases
Extract output streaming to extra function
use channel to communicate exit reasons

In order to streamline handling of the various exit reasons,
split out process lifecycle and timer.

Also use channels to tell WHY we need to exit now.
In case of timeout killing, we now collect the exit code of the dead
process and cleanly delete the lock instead of littering the system.
extract core logic

In order to easily change the core logic,
extract it into extra file and provide a bunch of related unit tests.
Use multiple channels in core loop

In order to react on multiple concurrent events in the core loop,
we need to use more channels and switch them on/off as needed.

We run as long as we have a process to nurse (watched at errc) and react
on other events while waiting for this process.

This make it easier to implement the following features:
 * soft kills (as just another timer)
 * retry of soft kills (timer + counter)
 * signal handling (just another channel)
 * retry of the command as new channel + new logstream + new new
   processLife)
Extract signalling functions
Handle deadly signals

Terminate child too on deadly signals, while it its started,
in order to compensate for us detaching the child from our process
group.
kill the whole child process group

In order to kill everything spawned by our child,
kill by process group and fall back to single process, if it is not
process group leader.
Add test for exit status
Fix comment
Merge pull request #34 from Jimdo/rework_core_logic

Rework core logic