The Parameterized Post-Friedmann Framework for Theories of Modified Gravity: Concepts, Formalism and Examples.