Stability Theory of Switched Dynamical Systems