Further refactoring work. Now the program mostly works, including exposures.
timedscan remains still.