Fixed warnings if Python is run with -3.

This also adds proper hashing and comparision support to
undefined objects.

This fixes #224