An infinite dimensional KAM theorem and its application to the two dimensional cubic Schrödinger equation