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.