anchor.diff:  //    ciphertext  = record.ciphertext
   //    iv          = record.iv
   //    record_hmac = record.hmac
  -//
  -//    encryption_key = bundle.encryption_key
  -//    hmac_key       = bundle.hmac_key
  -//
  -//    local_hmac = HMACSHA256(hmac_key, base64(ciphertext))
  -//
  -//    if local_hmac != record_hmac:
  -//      throw Error("HMAC verification failed.")
  -//
  -//    cleartext = AESDecrypt(ciphertext, encryption_key, iv)
  -
       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 =
  +
  +    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) |]
  + 
positive.code:         let url = (clusterURL username) + "1.1/" + username + "/storage/crypto/keys"
          fetchUrlResponse url "GET" (Some (username, password)) None None None
  
      type CryptoKeysPayload = { iv         : string
                                 ciphertext : string
                                 hmac       : string }
  
negative.code:     // http://msdn.microsoft.com/en-us/library/system.security.cryptography.aescryptoserviceprovider%28v=vs.110%29.aspx
      let DecryptAES (s : string) (key : byte[]) (iv : byte[]) =
          // Check arguments.
          if s.Length * key.Length * iv.Length = 0 then ""
          else
              // Create an AesCryptoServiceProvider object 
              // with the specified key and IV. 
              use aesAlg = new AesManaged()
  
              aesAlg.Key <- key
              aesAlg.IV <- iv
  