Re-organized logging and initialization.

Preparing piconfm logging and debugging.