attachments hash (Josh)

Picked and rebased the attachments part of https://github.com/elkarte/Elkarte/pull/397. Open for review.