Coding style and code hardening

This set commits contains mainly some minor style, log and code re-factoring fixes + some code hardening and possibility to give wbxml file as commandline argument for test-provisioning test.