Rewrite idx([p,1-p],i) to p^idx([1,0],i) * (1-p)^idx([0,1],i)
Rewrite idx([p,1-p],i) to p^idx([1,0],i) * (1-p)^idx([0,1],i)

because the latter is easier to integrate and recognize with respect to p

This is analgous to edd4261eb7be9acbf0c172170bc5c95e5ec870e9

With this change, we start to simplify Bind(BetaD(a,b),p,Categorical([p,1-p]))

zachsully/hakaru,zaxtax/hakaru,zachsully/hakaru,zaxtax/hakaru