Integrate functions multiplied by Heavisides

- uses manualintegrate to deal with complicated cases
Merge pull request #8015 from zanzibar7/rewrite_abs

Integration of Heaviside polynomials