Foundations of algebraic L-theory