Implement __len__ and __nonzero__ where appropriate.

This allows named fields to be tested e.g.
if m.pid.ssn_number_patient: ...
Merge pull request #2 from rectalogic/nonzero

Implement __len__ and __nonzero__ where appropriate.