Cast exception when pushing attachments during replication

Needed to use the AsDictionary<> extension method to get the
attachments to avoid an exception. (It can’t be cast since that object
is really a JSON object)
Added missing parenthesis.
Found and fixed another cast issue between a JSON object and Dictionary<string,object>
Found and fixed another JSON -> Dictionary cast issue.
Fixed another place where I ran into a cast exception.
Merge pull request #134 from jonlipsky/cast_issue_pushing_attachments

Cast exception when pushing attachments during replication