Probing the assembly of the Bacillus subtilis flagellum and its role in signal transduction