Scripting: Created a parameter parse to standardised script options
Tests: Enable check index in tests again.

* Run flush in beforeIndexShardClosed to prevent an empty shard.
* Only run check index if the shard state before closing was: started, relocated or post_recovery
Initial framework for Bucket Reducers
Aggregations explicitly return List of buckets instead of Collection
More framework
Buckets now do their own serialization so can be serialised outside of aggregations
Added context for BucketStreams to allow arbitrary attributes to be passed to buckets on deserialisation
started trying to implement sliding window reducer
trying to integrate bucket stream context into reducer framework
More wiring for the reducer phase
adds sliding window parser to ReducerModule
reducers now plumbed into the search process