Rewrite attachments directives and make them work as isolated components.
Normalize resource urls related to attachments.
Remove obsolete jade partial related to attachments.