Bit more robust build scripts, also added clean and rebuild script