changed tan and cot expansion, eval, and rewrite

* added expand(trig=True) for tan(x+y), tan(n*x), cot(x+y), cot(n*x)
* call sin and cos now to eval tan,cot at rational multiples of pi
* provide .rewrite(pow) and .rewrite(sqrt) for tan and cot
* added tests for tan and cot expansions
* added tests for rewrite(pow) and rewrite(sqrt)
* fixed tests in geometry to avoid eval of tan
* fixed a test in pretty printing to avoid eval of tan(pi/5)
improved tan and cot sum expansion formulas

* use symmetric polynomials
* sum formulas for tan and cot, implemented independently
* cleaned up rational*pi evaluation code
* removed I=sqrt(-1) import
* added test_tancot_rewrite_sqrt
* added tests for tan(x+y+z) and cot(x+y+z) expansion
* added test_tancot_rewrite_sqrt, with @slow decorator
* add slow decoration to test_trigonometry.py
Merged tan_expand with latest version of master
Merge pull request #1577 from zanzibar7/tan_expand

changed tan and cot expansion, eval, and rewrite
shorten long error messages; remove cruft line
edit iterable and is_sequence docstrings
add oset to compatibility
add convenience keys for laszyDSU_sort
1400: cse is deterministic and ignores singleton expressions

deterministic

Since cse relies on making substitutions at the very beginning
in the preprocessing, and substitution is an order-sensitive proceedure,
it was necessary to sort the Adds that are being identified in that
process.

The use of default_sort_key from the traversal was removed. This is not
needed in the sub-expression identification stage. The insert method
that sought to keep the expressions in order was also removed. The
default_sort_key applied in one branch of the expression tree in one
of the expressions given to cse doesn't guarantee that another expression
with the same key (as was defined in the insert method) will be in a
deterministic order -- the tie would not be broken.

So now all the expressions are collected however they come from the
tree and are assembled in set. These (and the Add and Mul terms that
are handled individually) are sorted with the lazyDSU sort which seeks
to put the items in some canonical order. This is the source, then,
of determinism in the method.

In addition, expressions that are only used once are no longer reported
in the returned expressions, e.g. whereas one might have gotten
[[(x0, x+1)], [cos(x0)]] perviously, now [[], [cos(x + 1)]] will be
returned.

The insert method used to keep the expressions arranged in a particular
order was removed since more than this is
move sorting functions to compatibility

In addition, the traversals are capable of a lazy sort
which should be faster when ties can be broken with a simple
count_ops comparison.
3460: watch for oo in ndiv

By watching for extractable negatives at the outset, the
problem can be circumvented. I'm not sure where the infinities
are being generated by such a simple substitution as
(-12*x).subs(-x,1).
3459: watch for nc during expansion

In addition, if something has a polar=False assumption, this doesn't
mean that it is a negative number, so None is returned if polar is False
in the sifting of arguments.

Tests were added to bring the coverage of Pow._eval_expand_power_base to
100%.
import cleanup and docstring example added
fuzzy_not with other fuzzy_foo; tweak fuzzy_bool

There were two fuzzy_nots; now there is one and all the fuzzy_foos
are in core.logic.

fuzzy_bool was optimized a bit to take advantage of the
current behavior of equality and is-checking being faster
than calculating the bool:

from timeit import timeit as t
>>> t('1 == True')
0.17005395889282227
>>> t('1 is True')
0.12167119979858398
>>> t('bool(1)')
0.3265230655670166
>>> t('bool(True)')
0.3634920120239258
args_cnc has flag to not split -1 from Number
3462: unification of _eval_power and _eval_expand_power_base

This is something that was sorely needed: much code was being duplicated
(incompletely) between Pow._eval_power and Mul._eval_expand_power_base.
The best of both has now been consolidated under Mul so it is now much
easier to maintain and to see what is part of auto-expansion in Pow and
what is not.

While working on this I realized that powers that weren't strictly Rational
could still allow separation of the bases and made that change in
simplify, too.

The test that was changed in arit was tested at Wolfram Alpha:
http://tinyurl.com/8vsbhzs
consolidate expand tests
fix Mul.flatten

It was assumed that only things like 2*sqrt(3) might be encountered;
with the changes that have been made, it is now possible to get
things that have more terms, so now provision is made for that.
fix powdenest test

fix meijerint test for simpler expression
pyflakes minor cleanups
add permutations to iterables imports