Run XeLaTex twice at the end

To make sure list of listings and images is generated right
Restructure a bit