Remove unused local variables on main common module file.
Simplify the tg-check-permission directive.
Rewrite attachments directives and make them work as isolated components.

Also, it fixes #914 issue.
Merge pull request #15 from taigaio/attachments-component

Attachments as components