Stats: Bugfixes and enhancements to indices stats API

Bugs:
* "groups" and "types" were being ignored
* "completion_fields" as wildcards were not being resolved to fieldnames

Enhancements:
* Made "groups" and "types" support wildcards
* Added missing tests

Closes #6390
Tests: Fixed indices.stats types test when run with replicas