Add support for diagnostic mode

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>
Fix warning for obsolete g_type_init

Signed-off-by: Philippe De Swert <philippe.deswert@jollamobile.com>