fix #394 tplScript unnecessarily extending Template

If a template had a CSS template with script in its dependencies, then
a circular dependency error might have happened due to that.

Close #395.