A Factored MDP Approach To Moving Target Defense With Dynamic Threat Modeling and Cost Efficiency