Observability and observer design for switched linear systems