Change  Reference#'ref to ref_id in db and #id in json.  Store references as an array instead of a hash

There is a matching commit in the rich citations repo