Fixed issue 3323

Implemented the resolution proposed by Aaron in the discussion
of the issue on the google code website:
http://code.google.com/p/sympy/issues/detail?id=3323
randomization: cse
rename core/tests/test_functions.py -> test_function.py

The pattern seems to be that the test file should be the same
as the file: foo.py -> test_foo.py
randomization: Subs uses dummies as private entities

Subs no longer uses dummy variables to rewrite the arguments of the
instance since this doesn't help in making comparisons between different
instances. Instead, symbols whose name is the string form of the point
value being substituted is used instead, but these symbols are used to
store a private expr where the symbols in the expr are replaced with these
new symbols (stored in ._expr and used for the hash and for making
comparisons in __eq__).

e.g.

Subs(x, x, 0)
    .expr = x
    .variables = (x,)
    .point = (0,)
    ._expr = _0
Merge pull request #1417 from smichr/rand

Randomization fixes3
Remove unused definition line that fails in python 3.
Merge pull request #1423 from jrioux/tests

Fix python 3 tests
added another test for tr on density op of spin states
style changes
Expr.expand: Always iterate the hints in the same order.

This means that, instead of directly iterating the dictionary,
Expr.expand now iterates the sorted list of keys.  These assures the
same order of invocation of _eval_expand_* functions.
meijerint_definite: Canonically sort the innermost points in reverse order.

This change seems to assure that meijerint_definite always returns the
simplified result.  Without this sorting, meijerint_definite would
return either the simple result, or a long expression which would
simplify to the same result.
LambdaPrinter: Sort .args before printing.

This avoids the dependency on the order in which the elements get into
.args.  This commit also fixes test_lambdarepr.py correspondingly.
_sqrtdenest0: Sort the .args before processing them.

This assures that this function always returns the same result.
matrices: Always sort the eigenvectors.

Also correct the tests according to the new values.
function.expand: Mention that hints are sorted by keys.

Expr.expand consecutively applies the corresponding methods to one and
the same instance of Expr, which makes the result actually dependent on
the order in which these methods is applied.
split_surds and _sqrtdenest1: Sorts .args before traversing them.

Unfortunately, different order of traversal yields different results
which, hopefully, are of the same level of notational complexity,
because commits such as this one fix only one of the possible results.
LambdaPrinter: Don't sort the arguments of Piecewise.

I have previously authored a commit in which I altered all
LambdaPrinter._print_* methods to sort the .args of their arguments.
This has resulted in nonsensical output for Piecewise, in which the
order in which the conditions were specified matters.  This commit
reverts the change to _print_Piecewise, but leaves the sorting intact in
_print_And and _print_Or.
PrettyPrinter: Add argument sort=False to _print_Function.

This commit makes the pretty printer sort the arguments of commutative
boolean functions.
LatexPrinter: Always sort the arguments of Min and Max.
function.expand: Further fix the docstring.

The docstring still contained a mention of hints being applied in
arbitrary order.