Elkpr/426

I have rebased https://github.com/elkarte/Elkarte/pull/426 to the updated master, and added a few fixes from https://github.com/joshuaadickerson/NotElkarte/tree/AttachmentThumb_new.
(This last branch was not rebased to master yet, when I fixed this PR.)

IMO, this is a very good (re)start on the (very spread out everywhere) attachments code. And it should be improved further. For example, add automanagement for updates that create a new thumbnail, and split out thumbnail creation in createAttachments. Also, we can eventually improve implementation when the needs of the code are more clear.
I think I would rather accept it though, and continue reimplementation of them attachments.