* change to use a custom generic save/load function to allow objects
  to use their own save/read/access functions.

* think about whether should just make .Last a non-tracked variable; it
  causes track.stop() when called from q() (as in testBrokenFileSystem.Rt)
  to need to save the tracking summary (because .Last was accessed, which
  changed the tracking summary).

* make interactive track.stop() handle more gracefully the situation where the
  tracking db becomes unavailable: disconnect all active bindings,
  but keep unsaved objects in place

* DONE: make track.start() read in .Last so that if the tracking
  db becomes unavailable, R can still shut down (because .Last will
  be cached, allowing it to be retrieved without accessing the
  file system.)

* DONE: make end-of-top-level-command syncing and cache flushing
  work in a global way doing all environments at once,
  allowing a policy to work across all tracked environments.

* DONE write a LRU policy plugin for caching -- add an
  option for how many bytes to keep, and flush from memory
  enough older objects to get under the limit

* DONE: add track.assign() that is like track(), but doesn't
  cache the value

* DONE: add a "track.plugin" man page and examples of use

* DONE: make the callback catch errors and always return TRUE, so
  that it doesn't get removed.  make track.auto(TRUE) check
  that the callback is in place.

* DONE: add 'inmem' & 'envname' to the args passed to a cacheKeepFun

* DONE: figure out a way of using full commands in history without
  inserting time stamps into the interactive history.

* DONE: link track.rescan() from track.sync.Rd

* DONE: track.stop() behaving weirdly -- saw tracking envs still attached -- fixed

* make track.sync issue a warning if variables are created in
  a readonly tracked env

* DONE: clean up examples in .Rd files -- make them simple
  pedagogic examples, not tests of functionality (the latter
  are in tests/*.Rt)

OK pkg/man/track.attach.Rd
OK pkg/man/track.auto.Rd
NONE pkg/man/track.design.Rd
OK pkg/man/track.future.Rd
OK pkg/man/track.history.Rd
OK pkg/man/track.manage.Rd
OK pkg/man/track.options.Rd
OK pkg/man/track.performance.Rd
OK pkg/man/track.rebuild.Rd
OK pkg/man/track.setup.Rd
OK pkg/man/track.status.Rd
OK pkg/man/track.summary.Rd
OK pkg/man/track.sync.Rd
OK pkg/man/trackObjs-package.Rd

* add FILE access and FILE write counters to the trackingSummary

* request .Last hook and a .Last.pre.ask hook (pre-question)
  (would go in src/gnuwin/system.c.  Printing messages from
  .Last is tricky because of order of how things appear to
  user: first comes the question, then if the answer to
  "save?" is not cancel, .Last is run, and save.image()
  called.
  - src/gnuwin32/system.c: in R_Cleanup, call to R_dot_Last
  - src/unix/sys-std.c: in Rstd_Cleanup, call to R_dot_Last
  - src/main/main.c: defn of function R_dot_Last
  - example of hook calling in

* test turning off writeToDisk and having that handled by track.sync() (need to think about what happens when an error in the computation occurs)

* write tests that .Last invoked flushing at the end of the R
  session does write out objects (a little tricky to test
  because the test needs to span multiple sessions)

* write tests that GC-triggered flushing at the end of the R
  session does write out objects (a little tricky to test
  because the test needs to span multiple sessions) However:
  This can't work very well because save.image() at the end
  will be run before finalizers

* DONE: make it easier to attach a new tracking env at position 2
 (current track.start(pos = 2, dir = "tmp4") gets several errors)

* DONE: need to store Sys.pid() in tracking env to detect
  situations where .trackingEnv was loaded back into the
  global env by saveimage()/loadimage(), but things are not
  set up properly.

* DONE: track.info() should detect the situation where
  .trackingEnv was saved & restored and is not active (look
  at saved pid)

* DONE: make track.history.load() filter out timestamps by default
* DONE: Think about automatic caching and garbage collection: now when a tracking env is garbage-collected at the end of the R session, if it isn't already flushed, it is flushed.
* DONE: write .Last.sys function that will call track.stop() (which calls track.sync(full=TRUE) and track.flush())
* add tests to testFollowObjs.Rout.save with recordAccesses=FALSE, and separately
  with maintainSummary=FALSE
* DONE: add tests for track.start(clobber="vars") and track.start(clobber="files")
* DONE: in track.start(), when clobbering files, make sure current var binding is not active (actually, this doesn't matter no -- we remove all clobbered var bindings before reassinging), and that var is trackable -- now gives a warning for untrackable/reserved/excluded var names
* DONE: in track.start(), need to check that files exist before clobbering vars, had this situation - now stop with an error message
* DONE: in track.stop(), replace .Last active binding by its value? (otherwise get an error when trying to run it?) - no seems OK
* DONE: in track.sync() handle the case \code{master="files"} and where objects are cached and where an underlying file is changed. (all cached objects are deleted)
* DONE: check if track.sync(master="file") is the same as track.rescan() - is now
* DONE: add argument to track.stop() to keep variables in R (do via track.remove/track.lift?)
* DONE: add tests for track.rescan(level="low") with changed file db (based on code in track.attach.Rt)
* DONE: add a read-only mode, and make that the default for track.attach()
* DONE: think about using lockEnvironment/lockBinding for a readonly tracking enviornment -- disadvantage is that it is a lot of work to change between readonly=TRUE and readonly=FALSE (solution was to just use lockEnvironment())
* DONE: write tests for track.attach(readonly=TRUE/FALSE)
* DONE: add docs to trackObjs-package.Rd to emphasize simple usage.
* DONE: add tests for track.attach()
* DONE: add track.auto() function to control use of auto-tracking (turn on and off, show status)
* DONE: change tests over to use auto=TRUE (the default), or duplicate for that case
* DONE: figure out what to do about the case of {rm(x); x <- 1} when auto=TRUE -- this results in x not having an active binding, i.e., it is masked -- maybe detect this by a cleanup on exit function, and/or by running a more general check every 5 mins

