Modified reference serialization to accomodate non-snaks elements such as the reference hash

Change-Id: I6ce7cc300c3fa7f685a5cf62322d92c670af2fc9
Merge "Modified reference serialization to accomodate non-snaks elements such as the reference hash"