Better thread handling, and added some optimisations.

Now all the thread logic is in `sched.c`, and the `block.c` file has not
to be aware of the threading stuff, including end of wait command
signal.

When a wait command and a normal command aware both configured, the wait
command will be launched in a thread at the same time as the normal command
on the first update.

If no blocks are updated in the main loop, no JSON will be sent to
output.
Removed test config file, and updated documentation.

I added examples for the `wait_command` configuration line.