reorganizes createTrialSpec

complete list of everything that createTrialSpec should do in what I
hope is final order, with placeholders moved outside of this function so
what's actually in the function is final, except a couple things marked
TBD.