Implement wbsetclaim function

wbsetclaim lets us add a claim and reference in one edit, but requires
us to create the serialized object ourselves.

Also added in proper handling of ranks.

Code based on Aude's PHP implementation

Change-Id: I599bd354c3e201149fd799b71937be0d7cc79f8e
Merge "Implement wbsetclaim function"