Finished remaining unit tests
Enforced presence of foreign keys in upvotes