Piecewise-holonomic mechanics, hybrid dynamical systems and escaping cockroaches