Foreign key field support

Allow configuring the field referenced on a foreign key.
Correctly output ON DELETE actions that should have spaces.
Reference fields with table name prefix in Selector classes.