Fix #50. New API for messages.
Fix #50. New API for messages.

FB sends 3 different things that contain different information:
- `attachments`: array of objects containing most of the important data
- `attachmentIds`: array of `ID`s (hopefully?) ordered in the same order
as the `attachements` array.
- `attachment_map` or `share_map`: a map from `ID` to more data

The docs will contain the exact specs (or point to `formatAttachment`)

Here are a bunch of examples of those data structures:

##attachement_map

{ id: '10207362631643471',
  fbid: '10207362631643471',
  type: 7,
  mime_type: 'application/octet-stream',
  filename: 'Gruntfile.kek',
  file_size: 1322,
  is_malicious: false,
  image_data: null,
  video_data: null,
  attribution: null,
  index: 0 }

{ id: '10207362632803500',
  fbid: '10207362632803500',
  type: 4,
  mime_type: 'image/jpeg',
  filename: '11798391_10207362632803500_1419117031_n.jpg',
  file_size: null,
  is_malicious: null,
  image_data:
   { width: 600,
     height: 900,
     render_as_sticker: false,
     url: 'https://scontent.xx.fbcdn.net/hphotos-xtf1/v/t34.0-12/11798391_10207362632803500_1419117031_n.jpg?oh=ca16a67bd8173ae6744918498fc61757&oe=55BFB047',
     preview_url: 'https://scontent.xx.fbcdn.net/hphotos-xtf1/v/t34.0-12/p206x206/11798391_10207362632803500_1419117031_n.jpg?oh=2c84358695b4b852c2e87ed52800946b&oe=55BFFB2E',
     image_type: 1,
     max_width: 600,
     max_height: 900 },
  video_data: null,
  attribution: null,
  index: 0 }

{ id: '10207362831008455',
  fbid: '10207362831008455',
  type: 8,
  mime_type: 'image/gif',
  filename: '11832952_10207362831048456_1758840983_n.gif',
  file_size: null,
  is_malicious: null,
  image_data:
   { width: 600,
     height: 400,
     render_as_sticker: false,
     url: 'https://cdn.fbsbx.com/hphotos-xaf1/v/t59.2708-21/11832974_10207362831368464_839049771_n.png?oh=5126b2670111f7ed0b09641f8cc25047&oe=55BFD21C',
     preview_url: 'https://cdn.fbsbx.com/hphotos-xaf1/v/t59.2708-21/p206x206/11832974_10207362831368464_839049771_n.png?oh=4ac8b4b13c1cb0c3822d4846cb58b28f&oe=55BFF97B',
     image_type: 1,
     raw_gif_image: 'https://cdn.fbsbx.com/hphotos-xpf1/v/t59.2708-21/11832952_10207362831048456_1758840983_n.gif?oh=41f8b62932085ed42d35c4b5f125a0de&oe=55BEB926',
     raw_webp_image: 'https://cdn.fbsbx.com/hphotos-xpt1/v/t59.2708-21/11808991_10207362831208460_780050817_n.webp?oh=6a9ba0bf600f57fa8b481dc600ad5f7c&oe=55BFB454',
     animated_gif_url: 'https://cdn.fbsbx.com/hphotos-xpf1/v/t59.2708-21/11832952_10207362831048456_1758840983_n.gif?oh=41f8b62932085ed42d35c4b5f125a0de&oe=55BEB926',
     animated_gif_preview_url: 'https://cdn.fbsbx.com/hphotos-xpf1/v/t59.2708-21/11832952_10207362831048456_1758840983_n.gif?oh=41f8b62932085ed42d35c4b5f125a0de&oe=55BEB926',
     animated_webp_url: 'https://cdn.fbsbx.com/hphotos-xpt1/v/t59.2708-21/11808991_10207362831208460_780050817_n.webp?oh=6a9ba0bf600f57fa8b481dc600ad5f7c&oe=55BFB454',
     animated_webp_preview_url: 'https://cdn.fbsbx.com/hphotos-xpt1/v/t59.2708-21/11808991_10207362831208460_780050817_n.webp?oh=6a9ba0bf600f57fa8b481dc600ad5f7c&oe=55BFB454',
     max_width: 600,
     max_height: 400 },
  video_data: null,
  attribution: null,
  index: 0 }

##attachements[index]

{ open_url: null,
  app_attribution: null,
  attach_type: 'file',
  name: 'Gruntfile.kek',
  url: 'https://cdn.fbsbx.com/hphotos-xtp1/v/t59.2708-21/11808947_10207362549641421_978595100_n.kek/Gruntfile.kek?oh=21ac1693057c4ddcedb5f5bcff80d118&oe=55BF7F8B&dl=1',
  rel: 'ignore',
  preview_url: null,
  preview_width: null,
  preview_height: null,
  preview_class: null,
  icon_type: 'attach:unknown',
  metadata: null,
  thumbnail_url: null }

{ app_attribution: null,
  attach_type: 'photo',
  name: 'image-10207362632803500',
  url: '/ajax/mercury/attachments/photo/view/?message=mid.1438464217417%3Ae729e6fd4008f9b012&fbid=10207362632803500&hash=AQC-tBzdroCQVYHu',
  rel: 'async',
  preview_url: 'https://scontent.xx.fbcdn.net/hphotos-xtf1/v/t34.0-12/p206x206/11798391_10207362632803500_1419117031_n.jpg?oh=2c84358695b4b852c2e87ed52800946b&oe=55BFFB2E',
  preview_width: 206,
  preview_height: 309,
  preview_class: null,
  icon_type: 'attach:image',
  metadata: { fbid: '10207362632803500', dimensions: '600,900' },
  thumbnail_url: 'https://scontent.xx.fbcdn.net/hphotos-xtf1/v/t34.0-12/s110x80/11798391_10207362632803500_1419117031_n.jpg?oh=ebf8c4835003f5e976a937073bf6ae18&oe=55BFEA99',
  hires_url: 'https://scontent.xx.fbcdn.net/hphotos-xtf1/v/t34.0-12/11798391_10207362632803500_1419117031_n.jpg?oh=ca16a67bd8173ae6744918498fc61757&oe=55BFB047' }

{ app_attribution: null,
  attach_type: 'animated_image',
  name: 'gif-10207362831008455',
  url: 'https://cdn.fbsbx.com/hphotos-xpf1/v/t59.2708-21/11832952_10207362831048456_1758840983_n.gif?oh=41f8b62932085ed42d35c4b5f125a0de&oe=55BEB926',
  rel: 'async',
  preview_url: 'https://cdn.fbsbx.com/hphotos-xfa1/v/t59.2708-21/11787551_10207362831448466_598012289_n.gif?oh=e7fd47a54c72b71052c676b61a69a392&oe=55BF81D0',
  preview_width: 600,
  preview_height: 400,
  preview_class: null,
  icon_type: 'attach:image',
  metadata:
   { fbid: '10207362831008455',
     image: 'https://cdn.fbsbx.com/hphotos-xpf1/v/t59.2708-21/11832952_10207362831048456_1758840983_n.gif?oh=41f8b62932085ed42d35c4b5f125a0de&oe=55BEB926',
     dimensions: '600,400' },
  thumbnail_url: 'https://cdn.fbsbx.com/hphotos-xpf1/v/t59.2708-21/11832952_10207362831048456_1758840983_n.gif?oh=41f8b62932085ed42d35c4b5f125a0de&oe=55BEB926' }

##share_map

{ media:
   [ { href: 'https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-xaf1/t39.1997-6/p200x200/851549_767334479959628_274486868_n.png',
       alt: '',
       type: 'link',
       src: 'https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-xaf1/t39.1997-6/p200x200/851549_767334479959628_274486868_n.png' } ],
  name: '',
  href: 'https://fbcdn-dragon-a.akamaihd.net/hphotos-ak-xaf1/t39.1997-6/p200x200/851549_767334479959628_274486868_n.png',
  caption: '',
  description: '',
  properties: [],
  icon: 'https://fbstatic-a.akamaihd.net/rsrc.php/v2/yD/r/aS8ecmYRys0.gif',
  tagged_ids: [],
  sticker_id: '767334476626295' }

ravkr/facebook-chat-api,AdamBurgess/facebook-chat-api,Schmavery/facebook-chat-api,GAMELASTER/facebook-chat-api,noodle-learns-programming/facebook-chat-api,tpphu/facebook-chat-api