tmp - adding sqlitedb tests. cleaned up and improved some comments and formatting