Preliminary adoption of SQLite/SMWSQLStore3Query to make tests work

This is necessary to make sure that regression/integration tests run on
SQLite as well otherwise you get whole lot of errors.