allow for lambdas to be passed to this to allow dynamic ES server discovery
allow using blocks, add tests for same