split up code into RSessionManager, add configuration for R session
memory