Avoid atoi, use std::stoi(), etc.

This is closer to the C++ standard and also avoids some casts.
Merge pull request #21 from vog/avoid-atoi

Avoid atoi, use std::stoi(), etc.