Added monotonicity test and changed io tests slightly.
Changes to writing/reading. Progress on automating loading of self-caches and on making code thread/env safe.