Moved the array uniqueing functionality to a generic class.