Matrix Factorizations and A-infinity Algebras