Move code for injecting the edit/add links link into class and add tests

Change-Id: Iba5f6ab9366798e82b137153551e91a45f2fe444
Merge "Move code for injecting the edit/add links link into class and add tests"