registering native routines with R
added some tests
fixed finalize prototype, cleaned up ~ files