Allows ForeignField references by class or by name.

[Resolves #76]
Reorders tests.