Check that expr is Expr before matching it

Fixes issue #2711
Fix bug in manualintegrate u-substitution

- New integrand will not contain original variable of integration
- Simplify and correct calculation of 'constant'
Don't include DontKnowRule in AlternativeRule unless necessary
Use TrigonometricFunction instead of listing trig functions
Further simplify manualintegrate u-sub heuristic
Add test for manualintegrate u-sub heuristic
Merge pull request #7459 from lidavidm/fix_2711

Fix #2711