Registering native routines with R

I believe this registration will greatly improve I/O performance at scale.

These changes were very sweeping, and if there is a mistake, then a calling R function will error, so I added a few tests as well.  Encourage you to expand them.