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.

Thanks for the JOIN/FK support. I've been playing with it today and it works. I've committed some changes for little issues I've run into.

I'm thinking it would be nice to be able to have the same fields on joined tables. Do you have any thoughts on that (or other aspects to doing joins)?
I don't understand why this is needed.