The Transfer Matrix Method and the Theory of Finite Periodic Systems. From Heterostructures to Superlattices