Merge "Switch ReferenceWithHistory to use ArrayDeque" into rvc-dev