Pre Re Factor for SQLite module

Preparation to split off SQL code into independent structure