Femtosecond dynamics of excitons in quantum wells and quantum well microcavities