Towards a general theory of systems accidents