Extract metadata getter into software_metadata. Various fixes.