Reworks key option into primary and foreign keys

excludes a few lines from coverage calculations to get us to 100% coverage
fix so name spaced models can be used