Foundations of Average-Cost Nonhomogeneous Controlled Markov Chains