Applications of dynamical systems to Farey sequences and continued fractions