Use the HTTP user name, add a config file for ES settings, minor style corrections

- Use the HTTP REMOTE_USER as the user name for further processing
- Move all ES settings to config.php
- php://input is not a nginx oddity, but necessary for JSON in general
- The response header MIME type should be application/json
Resolve 2 query cases not returning proper results

- Facet queries would loop until they hit the PHP memory limit in cases where
  the array index would not start from zero
- Empty queries yield incorrect JSON structures as a result
- Unify tabs/space use in index.php