Add compare, serialization and deserialization functions https://bugzilla.gnome.org/show_bug.cgi?id=772764