Fix "Operation could destabilize the runtime" error when passing a dicti...

Workaround for what appears to be a bug in CavemanTools - if .ToDictionary() is called on a dictionary, it will fail with the rather uninformative exception "Operation could destabilize the runtime". This works around it by simply checking if the data object implements IDictionary<string, object> and if so, not running ToDictionary() on it, since it doesn't need to be converted anyway.