Add full subdoc support to Javascript client

It would be nice to either show what types of errors might commonly occur (ie patch_conflict) or say as much and link to the (not-yet-published) www docs. Not really anything specific to patch though, we haven't documented error handling well in general.