fix attribute error when reading a mix of valid and invalid records; issue #16
refactor and use the ternary operator, available since Python 2.5
fix a crash with built-in OS X readline on Python 2.5 or 2.6
small cleanup
fix dir() on Record and RecordList