Use inherits() to test an object's class.

Related: #26

This includes `jobjRef ` and `RDD` and I left out the primitive types:
```
./pkg/R/utils.R:168:  if (class(key) == "integer") {
./pkg/R/utils.R:170:  } else if (class(key) == "numeric") {
./pkg/R/utils.R:175:  } else if (class(key) == "character") {
```