implemented corrections related to foreign keys, delete on cascade and R...

with the following pull request i've fixed problems related to foreign keys.

in particular:
 - foreign keys were not enabled and need a storm patch that is now waiting to be integrated in storm.
 - two referenceSet were inverted in definition; i noticed it after i enabled foreign keys in sqlite; now all is fixed.
- i've also enabled WAL

by the way if WAL and foreign key are not enabled in Storm all continues to work so this code can be cleanly integrated in master