More robust factor_nc().

If factor_nc() can't factor an expression, it should just return it
unchanged, not throw AssertionError.

In order to get a factorized result that matches the unfactorized
input expression in some cases involving powers of a Mul, we now
call powsimp() in addition to factor(). Thus it becomes necessary
to call expand(power_exp=True) when checking the result.

Fixes issue 3602.
Rename _mexpand -> _pemexpand in sympy/core/exprtools.
Merge pull request #1760 from jrioux/factor

More robust factor_nc().