Added a test for QuerySet.distinct() (#160).
Implemented QuerySet.distinct(). Closes #160.
Move from obj.__metaclass__ to type().

Refs #143, #149, #156.
Removed dead code (IdLookup.nodes()) from base.py.
Added a test for QuerySet.reverse() (#161).
Implemented QuerySet.reverse(). Closes #161.
Added a test for QuerySet.latest() (#158).
Implemented QuerySet.latest(). Closes #158.