rearanged some of the foreign keys, and gave them related names to all relations

Signed-off-by: Gregory Klupar <Klupamos@gmail.com>