Intelligent association typing

Should allow associations to automatically create foreign keys of the
same time as the primary key(s) of the model they reference. Has the
side-effect of also allowing associations to automatically create the
required foreign keys for models which have multiple primary key fields.