Activating sql auditing tests

and some refactorings