An open systems approach to quantum optics