Applies simple to-date conversion for every date property of a payload, as defined in the schema provided.
function formatDate (payload, schema) {
  _.forEach(schema, function(v, k) {
    if (v !== null && v._type === 'date') {
      if (payload[k] !== null) {
        payload[k] = new Date(payload[k])
      }
    }
  })
}