Add dumper support for FOREIGN KEY.

Refer to the new test case for some of the subtler cases:
* If data is dumped too, the FK constraints are added at the very end because they will depend on data being present in both tables.
* Before the DROP IF EXISTS can be done, all foreign keys must be gone. In many cases, this is just a matter of dropping some other table first. But if the constraints are circular, all we can do at present is try to drop one of the constraints and then some tables.
* There is no way to do this FK drop without error, so the user will have to ignore it when loading such a file, as does the test framework.