Configure Elasticsearch port dynamically via window.location.port with 9200 as fallback

This makes Kibana behave nicely when installed as an Elasticsearch plugin - see also #370