Enable foreign keys for Sqlite3

This enables foreign keys in the sqlite3 scheme. It also provides a migration-script to enable it in existing setups.

There are also regressiontests included.