dynamic templates

Added the possiblity to use dinamyc templates. For example:
    
        elasticsearch {
                            cluster => "logstash"
                            index => "%{type}-logstash-%{+YYYY.MM.dd}"
                            template => "/etc/logstash/conf.d/%{type}-template.json"
                            template_name => "%{type}"
            }
    
It will also allow to parametrize the template. For example:
    
    {
        "template": "%{type}-",
        "settings": {
          "number_of_shards"            : 5,
          "index.cache.field.type"      : "soft",
          "index.refresh_interval"      : "2s",
          "index.store.compress.stored" : true,
          "index.query.default_field"   : "@message"
        },
        .......
    }

Or it's going to have to be semi-manual, e.g. using conditionals and %{type} to have separate outputs which each reference their own template file.

Even if we try to tie in the ES mapping API you'd still end up with a test for each event.  This is a tricky edge case to handle dynamically.