unit tests for destroy.js and save.js, plus test improvements elsewhere