More progress on EntityCollectionIndex and tests.
Adding Apache license header.