Auto-detect server if running as es plugin

This makes it easier to run sense as an elasticsearch plugin by trying to auto-detect the es server based on the document location.

See issue #21 for more info.