Observability and Controllability of Piecewise Affine and Hybrid Systems