Fix a bug in duplicate detection
This is caused by AppEngine's inability to sort a query when the
inequality or IN operator is used. See also [0].
[0] http://code.google.com/p/googleappengine/issues/detail?id=1100
Patch by: Sverre Rabbelier and Lennard de Rijk
Fixes access check for manage view.
Added forgotten IsMyEntity check and fixed a bug introduced by a rename in r2816.
Addresses Issue 584.
Patch by: Lennard de Rijk
Reviewed by: to-be-reviewed