Restart Wang's algorithm with appropriate polynomial (#3256)
Staging of the new differential_geometry module.

This module is based on "Functional Differential Geometry" by Sussman and
Wisdom.

Import:
-------
It is not automatically imported by `from sympy import *`. To import it use
`import sympy.differential_geometry`.

Structure:
----------

The first patch brings the basic `Manifold` and `Patch` classes which are not
much more than containers for objects defined on the Manifold.

Each `Patch` can define a number of `CoordSystem` objects which contain all the
logic necessary for coordinate transformations.

`Point` instances can be defined using coordinates in a `CoordSystem`.

`ScalarField` objects can be defined. They take a point and return a scalar.

`VectorField` represents an operator on `ScalarField` (a directional
derivative).

Rudimentary docstrings are provided.

Predefined Manifolds:
---------------------

The R2 manifold is predefined in order to facilitate work on this manifold.
To import it use `from sympy.differential_geometry.Rn import R2, R2_r, R2_p`.
R2 is the manifold and R2_r and R2_p are the rectangular and polar
`CoordSystem` instances.

Other predefined manifolds will be supplied also.

Tests:
------

Test with complete coverage are provided. The examples from "Functional
Differential Geometry" are also provided as tests.

The only part that is not tested is unfinished functionality related to the
connections between coordinate systems.

The test_args.py test that check whether the args are instances of Basic are
XFAILed at the moment.
Mark coordinate-dependent attributes in differential_geometry as private.

An underscore was appended to all attributes that are coordinate-dependent.
jscode (javascript) printer added
added jscode.py to sympy/printing
added test_jscode.py to sympy/printing/tests to test jscode.py
modified __init__.py files to pull in relevant jscode for imports
has() refactoring: extract single pattern base case into ._has()

+ Simplify common case, when the pattern is an ordinary Basic instance.
Move preorder_traversal to sympy.core.basic

This will allow it to be used everywhere, and in particular in the core.
Use preorder_traversal in Basic._has()
Simplify Basic.atoms() and use preorder_traversal()
Use preorder_traversal() in Basic.find()
Use preorder_traversal in Basic.count()

* Extract query preprocessing from Basic.find() into _make_find_query(),
  to allow Basic.count() to use it directly.
Simplify code in Basic._has()

* iterative was always True
* the argument of _ncsplit is always an Add or Mul
Basic._has: remove inner function _match()

* .has() shouldn't support objects with non-Basic args, like
Tuple(sin, cos) (cf. issue 2070).
Simplify inner functions in Basic._has()
Basic.has(): move handling of AssocOps to AssocOp

Instead of hardcoding the matching function inside Basic,
pattern._has_matcher() is now used, thus removing a dependency
of Basic on its subclasses.
Fix (x*y).has(x+y) and similar cases.
preserve ability to test for bool and Function in Tuple
Bring the SparseMatrix constructor in compliance with the Matrix class

The SparceMatrix constructor was duplicating code and some of the semantics
were different from those imposed by MatrixBase. Now the
_handle_creation_inputs is used for all inputs for wich we do not have special
sparce logic.
nsimplify expr: use simultaneous substitution

nsimplify has troubles with the Floats in this expression because while doing
successive substitutions. The expression changes and creates new
Floats that weren't detected in the call to atoms. Using xreplace (with a
dictionary of replacements) does not work either. Simultaneous
substitution solves the problem:

-3.0*z**2*(x**2 + y**2 + z**2)**(-2.5) + 3*(x**2 + y**2 + z**2)**(-1.5)
>>> eq=_
>>> nsimplify(factor(eq.subs(x,0)))
-3.0*z**2/(y**2 + z**2)**(5/2) + 3.0/(y**2 + z**2)**(3/2)

Notice the leading 3.0 which should be a 3. This is fixed by this
commit.
Merge pull request #1339 from smichr/nsimp

nsimplify expr: use simultaneous substitution
Presenting newplot.py

A new plotting framework supporting numerous backends.

Two files are present:
plotting/newplot.py containing the module
test.py in the root containing some examples

See the docstring of newplot.py for implementation details.

It has 2d and 3d plots, parametric plots and contours.

Example:

a = Plot(x**2, x, 0, 10)
a.title = 'A Figure'
a.xlabel = 'The argument'

A big and dirty commit.

The current version of matplotlib (1.1.0) has a bug so some
of the 3D stuff does not work.
Concerning the bug - it's reported, but to fix it now try this:
/usr/lib/pymodules/python2.7/mpl_toolkits/mplot3d/axes3d.pyc in set_autoscale_on(self, b)
    252         """
    253         Axes.set_autoscale_on(self, b)
--> 254         self.set_autoscalez_on(self, b)
    255
    256     def set_autoscalez_on(self, b) :

TypeError: set_autoscalez_on() takes exactly 2 arguments (3 given)
I believe there is one self too much.