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