factor out common bcast/gather/scatter code in IO_Stmt & SMS_Serial classes
more refactoring