Code refactor. First step.

Convert to classes.
Fix warnings (-Wall).
Convert char* to std::string.