Chain folding and polymer crystallization: A statistical–mechanical approach