The Abstract Structure Of Quantum Algorithms