Added tests for basic relationship manipulation, fixed a few minor bugs