Fix import for msa_cb
Clean up imports
Remove some unsed globals.  Declare msa as global in all routines
where it is used.