This section provides that the following persons may be charged and tried together, namely : (1) persons accused of the same offence committed in the course of the same transaction; (2) persons accused of abetment or an attempt to commit such an offence; (3) persons accused of different offences committed in the course of the same transaction