Information Theoretic Properties of Markov Random Fields, and their Algorithmic Applications