Added foreign keys functionality + tests

Major change to modeler.define(); first argument is the model's name now.