Add support for dynamic templates

https://github.com/ruflin/Elastica/pull/358/files