refactors R C++ code as per changes to C++ lib
minor C++ lib changes
refactors SQLite extension for refactors of C++