Misc cleanup.

Change-Id: Ia3d0f2e098804dabdbdd324562097b9f69528d35
Protect access to the terminate flag.

Change-Id: I9c47e8f114f3d4dcdd5e62b1fffd2b65e7bfb00e
Disallow direct access to member variables.

Change-Id: I82d6c2a2c2844fbb6c2976327b129e42f6b63053
Parse CSV lines in the reader thread.

Change-Id: I6329a0e6e6fa6576df2ed473482d558bfd6cce08