implement calculation of STAR acceptances

This is a slight refactoring of Scott's and Garry's code.

Use switch statements where appropriate (in one case this should
improve performance) and return structs instead of modifying parameters.
use STAR cuts when calculating balance functions