Make adding links idempotent, add unit tests for removal