improved graphing support robustness

refactored methods related to graphing
simplified logic
use system() to call R
tweaked R scripts bit
tweaked signal hanlder
log on EXIT
cleanup