Add sqlite3 hook, fix encodings issue and update license header in tests.