Rework TemplateParam to work with newer Jade versions. Also update Jade.

Jade included a breaking change in 0.31 . It prevented the template() function of TemplateParam from accessing it's own properties (this was equal the global object).

To fix it I wrapped the whole thing in a closure and added a var to preserve the local context. This continues to work with older Jade versions as well.

There's one more change in Jade 1.0.0 relevant to this project: !!! 5 has been deprecated for doctype html . I have updated the example accordingly.