finalize mask generation for beam, including th e moving reference frame
various small improvements (strlen, comments, motion protocoll solid, mask_volume, string comparison)