refactor attachment module
Merge pull request #75 from koboshi/develop

refactor attachment module