Add type provider for remote R session.

Includes a few concurrency fixes and necessary refactoring of RInterop
to reuse functions for both local and remote R interop.