Fold getPairs and removePairs functionality into get() and remove()

Updated unit tests.