Rebuilding templates after application editing

Fixes #1389