Isolated and Dynamical Horizons and Their Applications