save history in a more json-like and more processable format
infer next build-number from current pipeline state instead of being counted seperately