anchor.diff:  
       let keepAsciiPrintableChars (x : string) =
           x.ToCharArray() |> Array.filter (fun x -> if int x < 32 || int x > 126 then false else true) |> fun x -> new string (x)
  -    
  +
  +    // http://www.fssnip.net/3y
  +    let getRecordFields (r: 'record) =
  +        typeof<'record> |> Microsoft.FSharp.Reflection.FSharpType.GetRecordFields 
  +        
  +    let getRecordField (r: 'record) (field : Reflection.PropertyInfo) =
  +        Microsoft.FSharp.Reflection.FSharpValue.GetRecordField(r,field) |> unbox
  +        
  +
       // Cryptography
   
       // E:\projects\fs-random-snippets>"%HOME%\Documents\Visual Studio 2012\Projects\Tutorial3\.nuget\nuget" PBKDF2.NET
  
positive.code:         failwith "syncKeyBundle failed"
  
      
      // writeSecretKeysToDisk
  
      try
          writeSecretKeysToDisk secrets.username secrets.password None
      with | _ -> failwith "writeSecretKeysToDisk failed"
  
  
  module CryptoKeys =
      open Secrets
      open Utilities
  
      let sk = readSecretKeysFromDisk None |> JsonValue.Parse
      let sk_pl = (sk?payload).AsString() |> JsonValue.Parse
  
  // https://docs.services.mozilla.com/sync/storageformat5.html
  //
  //    ciphertext  = record.ciphertext
  //    iv          = record.iv
  //    record_hmac = record.hmac
      let record = { iv         = (sk_pl?IV).AsString()
                     ciphertext = (sk_pl?ciphertext).AsString()
                     hmac       = (sk_pl?hmac).AsString() }
  //
  //    encryption_key = bundle.encryption_key
  //    hmac_key       = bundle.hmac_key
      let bundle = syncKeyBundle secrets.username (secrets.encryptionpassphrase |> base32Decode)
  //
  //    local_hmac = HMACSHA256(hmac_key, base64(ciphertext))
      let local_hmac = record.ciphertext |> Convert.FromBase64String |> (new HMACSHA256(bundle.hmac_key)).ComputeHash
  //
  //    if local_hmac != record_hmac:
  //      throw Error("HMAC verification failed.")
  //
  //    cleartext = AESDecrypt(ciphertext, encryption_key, iv)
      let cleartext = DecryptAES record.ciphertext bundle.encryption_key (record.iv |> Convert.FromBase64String)
  
  module Collections =
      open Secrets
      open ServerAPI
  
      let s = Secrets.secrets
      let url = clusterURL s.username
      
      // https://github.com/mikerowehl/firefox-sync-client-php/blob/master/sync.php#L94
      let fetchCollection username password collection =
          let url = (clusterURL username) + "1.1/" + username + "/storage/" + collection + "?full=1"
          fetchUrlResponse url "GET" (Some (username, password)) None None None
  
      let bm' = fetchCollection s.username s.password "bookmarks"
  
      let parseCollection collection = 
          collection
          |> JsonValue.Parse 
          |> fun x -> x.AsArray() 
          |> Array.map string 
          |> Array.map (fun x -> JsonValue.Parse x) 
          |> Array.map (fun x -> (x?payload).AsString())
          |> Array.map (fun x -> JsonValue.Parse x)
          |> Array.map (fun x -> { iv = x?IV.AsString(); ciphertext = x?ciphertext.AsString(); hmac = x?hmac.AsString() } )
  
      let bm = parseCollection bm'
      let key = 
          CryptoKeys.cleartext 
          |> keepAsciiPrintableChars
          |> JsonValue.Parse 
          |> fun x -> (x.GetProperty "default").AsArray()
          |> fun x -> x.[0].AsString()
          |> Convert.FromBase64String
      let cleartext = [|for b in bm do yield DecryptAES b.ciphertext key (b.iv |> Convert.FromBase64String) |]
  
  
      let cleartext' = 
          cleartext
          |> Array.map keepAsciiPrintableChars 
          |> Array.map JsonValue.Parse
  
      let x = 
          cleartext'.[0] 
          |> fun x -> x.TryGetProperty "keyword"
          |> fun x -> match x with | Some x -> x.AsString() | _ -> ""
  
      let x' = 
          cleartext'.[0] 
          |> fun x -> x.TryGetProperty "parentName"
          |> fun x -> match x with | Some x -> x.AsString() | _ -> ""
negative.code:                                ciphertext : string
                                 hmac       : string }
  
      let writeCryptoKeysToDisk username password (file : string option) = 
          let secretKeys = fetchCryptoKeys username password
          let mutable file' = ""
          match file with 
  