Photoemission studies of functional organic materials and their interfaces