Added more sqlite functions for storing spf.
Moved from Qt sqlite3 to native python sqlite3 API.