Theoretical and Numerical Methods for Modified Gravity