Distil debug output, add some additional assertions

Replaces g_warning and g_print by NG_DEBUG where sane.