Make dwarn function external
When iterating with a Perl object, only call process_*_record methods that exist

Add some error checking to iterate() and tests for it