logiQL

merge and rework #1324 fix logiql mode
@lennartcl