Fix some cppcheck warnings
- Make constructors with one arg explicit (they are private API, we can change them without breaking BC)
- Reduce scope of some vars
- More STL algorithms instead of for loops
- Don't check if an unsigned integral type is less than 0, which never happens if it's assigned a negative value it'll wrap
NO_CHANGELOG