Implemented es_clean_up: changed getTypeCount to use adaptors getIndex.
Implemented es_clean_up: added testGetTypeCount