Add caching to sleeping pure computed observables and other minor fixes

This is mainly in response to #1531, although I had the idea to do this before 3.2.0 was released. It also includes the fix for #1515.