Fixing some issues w/ cacheless testing.

A number of tests were failing when the cache was turned off. Main fixes
included changing some "is" statements to "==" statements, and implementing
equality/sameness tests for UndefinedFunction and AppliedUndef.

Still have 2 errors present, in test_diffgeom and test_traverse.
test_expr_fns safe against no-caching

In general the `basic` contruction functions can't be used with
Expr arithmetic operators.  The tree needs to be constructed explicitly

This commit replaces x + 1 with Basic.__new__(Add, x, 1)
and removes the equality test prior to reconstruction
Merge pull request #6 from mrocklin/cacheless

test_expr_fns safe against no-caching
Made a speed improvement for some comparisons

_aresame and Basic.__eq__ had to increase in complexity a little in order to
deal with cacheless operation. This makes a change to speed them up a little
(or in some cases, a lot). Uses zip_longest from itertools rather than zip in
the function _aresame. This way, if two objects don't have the same number of
arguements, they will not be equal. Previouly, if you had two similar objects,
i.e. f(x, y, z) and f(x, y), occasionally they would be equal, because the z
symbol wouldn't be checked against None.
Import zip_longest into compatibility

Instead of importing zip_longest (or izip_longest) into Basic, they are
imported to compatibility and it is ensured they have the same name in all
Python versions: zip_longest
Changed some Dummy substitutions.

Previously, when taking the derivative of something like:

f(f(x)).diff(x)

You receive a Subs(Derivative(...), (..), (..)) object which uses dummy symbols
at the point the derivative is taken at.
What this change does makes it so that the dummies in this example are given a
.dummy_index attribute which is equal to the hash of the object they are
replacing.
That way, f(f(x)).diff(x) == f(f(x)).diff(x).

This also fixes the error w/ cacheless operation w/ the diffgeom module.

Also, removed XFAIL from test for issue 1612.
Removed old commented out lines
Changed sym matrix doctest from is to ==
Merge pull request #2387 from gilbertgede/cacheless

Fixing some issues w/ cacheless testing.

A number of tests were failing when the cache was turned off. Main fixes
included changing some "is" statements to "==" statements, and implementing
equality/sameness tests for UndefinedFunction and AppliedUndef.