Open and real Gromov-Witten invariants: theory and applications