Rework error handling, add stamps, move prepare to main build script