Algebraic Discrete Morse Theory and Applications to Commutative Algebra