Some first steps towards making the beamspot algorithm and associated tools reentrant, and some cleanup.