Formation and Evolution of Planetary Systems and Detection of Habitable Worlds