Theory of thin shells