Rewrite the firmware and toolchain build system