Statistical Thermodynamics of Self-Assembly: Structure and Phase Transitions in Micellar Solutions