Import changes! (and headless queries handling)

Import changes in files:
queryExecutor/safetyChecker.py
queryExecutor/preprocessor.py

Also headless queries handling.