split up P2 creation of metadata and extraction of osgi metadata
fix a nasty iteration bug