Adding code to support mode from command line. Adjusted quotes for consistency.
Fixed typo.
Trying to fix crash after first record, removing rstrip() from yield in raw mode
adding sys.stdout.write call in output_records
added needed parameter to call
fixing call to sys.stdout