Amendment to last fix.
Allow calling ModuleAppManager with an empty shutdown hook.
Adapt tests to new situation.

- Use reflection to work around private ModuleMain functions.
Add  a shutdown() to FunctionBlocks.

- add a shutdown method to blocks, which will be called when shutdown is
  triggered and after all pending inputs and tasks have been processed.
  (Blocks will not be prevented from sheduling themselfes new tasks)
- Also functionality to forcefully kill the shutdown should it not
  finish within a given time.