Towards a Systems Theory of Algorithms