Updated to work with IR-0.6.0

@cmather - no rush, but when you have a free moment,
can you take a look at lines 69-91 of this file.

It's a strong argument for an onSetTemplate hook in
the router (which I think you advocated as the right 
way to do this anyway). Let me know if you have any extra thoughts.