Convert C sources to C++.

To help refactoring the FILE* access behind an interface and better
integrate with unittest code, this patch moves the C sources to C++.
Minor changes to make this conform to C++ were included.

Bug: 24478450
Test: `make all test && ./unittests`; mm

Change-Id: I27d7fb0660efc18ea0cb84ff544c9dd9c4803050
12 files changed