added option to output all bead images to .xyz

a few other small changes to make the code more organized