Add truth value test

Added both __nonzero__ and __bool__ for portability.