Better on-demand toggling and template applying

Better is always up for interpretation. Here is my take. I've tested it and it works well for me.
This might be considered good enough to allow the toggleTask on-demand options to be used by ordinary users.