quad: split up polynomial buildup and Q and q computation
fixes