Start using '\n' rather than std::endl, some code cleanup