Introduced _cache_key for sage objects

No meaningful hash function can be defined for elements which overwrite the
operator == like the p-adics do since the contract on __hash__ would be broken:
elements which compare equal would have different hash values. This would break
caches and lead to subtle bugs. Still such elements should be cacheable for
performance. As a workaround, such non-hashable elements can define a
_cache_key which uniquely identifies them, and so fixes the "broken" ==
operator.
Merge branch 'u/saraedum/ticket/16251' of git://trac.sagemath.org/sage into ticket/16316
Implemented _cache_key() for polynomials

This allows caching of polynomials with unhashable coefficients.
Enable caching for non-hashable objects

Objects whose == operator is broken by design (such as p-adics) should still be
cacheable if they define a _cache_key. This enables caching in
cached_function/method for such objects.
Do not unpack hashable entries of tuples when looking for a cache key for unhashable elements in sage.misc.cachefunc
improved docstring of SageObject._cache_key
Merge branch 'develop' into ticket/16316
Include an element's parent in _cache_key()

See http://trac.sagemath.org/ticket/16316#comment:8 for a discussion of this.
Trac 16316: reviewer patch
Trac 13613: added residue() for padic extension elements.
Merge branch 'develop' into ticket/13613
Minor changes to residue() of padic elements

These changes were necessary to rebase the patch in #13613.
Improved docstrings of SageObject._cache_key() and related methods
Merge branch 'u/pbruin/16316-cache_key' of git://trac.sagemath.org/sage into ticket/16316

Conflicts:
	src/sage/structure/sage_object.pyx
fixed docstring
Include parent instead of id(parent) as first entry of a cache key
Review changes.
restore previous version of _cache_key() in cachefunc.pyx
reverted changes which treated _cache_key like an attribute
removed debug output