Nuke duplicated code

This has been forgotten when splitting the lib into multiple files.
Close #9 Support registering FK constraints