Planetary Systems: Detection, Formation and Habitability of