adding templating in opentsdb graphs

I find that templated dashboard is a really great idea. Unfortunately it was not possible to do it with Opentsdb based graphs. Here is a quick hack to make it works fine.