State variables and dynamics of economic complexity, and their connection to economic performance