poly, imex: Tidy and change 'integrate' to use q_mat.

Signed-off-by: Matthew Emmett <memmett@gmail.com>