Fix parsing of file based template loading

We support three different settings in templates

* "settings" : { "index" : { "number_of_shards" : 12 } }
* "settings" : { "index.number_of_shards" : 12 }
* "settings" : { "number_of_shards" : 12 }

The latter one was not supported by the fix in #4235

This commit fixes this issue and uses randomized testing to test any of the three cases above when running integration tests.

Closes #4411