Statistical thermodynamics of polymer crystallization