Added foreign key for Relation model in database
Cleaned up and added tests for db_manager
(John K, Sam N)