Foundations of statistical mechanics, entropy and thermodynamics