change internal refs structure to array for multiple refs with same URI

update tests and add test for multiple refs