New Mexico court strikes down move to repeal energy codes