Renamed spec search.template.json to search_template.json
to match the name of the method.
Close Directory / Store once all resources have been released

Currently we close the store and therefor the underlying directory
when the engine / shard is closed ie. during relocation etc. We also
just close it while there are still searches going on and/or we are
recovering from it. The recoveries might fail which is ok but searches
etc. will be working like pending fetch phases.

The contract of the Directory doesn't prevent to read from a stream
that was already opened before the Directory was closed but from a
system boundary perspective and from lifecycles that we test it seems
to be the right thing to do to wait until all resources are released.

Additionally it will also help to make sure everything is closed
properly before directories are closed itself.

Note: this commit adds Object#wait & Object@#notify/All to forbidden APIs

Closes #5432
Add the `field_value_factor` function to the function_score query
Add a `modifier` parameter to the field_value_factor function
Add FieldValueFactorBuilder builder class
Add license headers, javadocs, and explain functionality
Type -> Modifier
handle NaN and Infinite numbers
Add test for FunctionScoreFieldFunction
Actually run index creation with .get()