Unit tests and code reorganization
add sqlite wrapper mock