The nucleus of Comet 9P/Tempel 1: Shape and geology from two flybys