Purification, reconstitution and polymorphic transition of halobacterial flagella