Added exclusion of $db, $ref, and $id to StorageDocumentFieldNameValidator.
Fixed bug in DistinctOperation, which was assuming that all the values are strings.