Let scripted dashboards return promises

Let dashboard defining scripts return a jQuery promise, making it possible to define a dashboard asynchronously.

This will make it possible to e.g. do an initial search with a term aggregation and create a query per term.