Complete redesign of the saved-state mechanism, providing the possibility of `program resources'. See resource3, open_resource3, and qsave_program[1,2].