The code that determines what is a ship class, in regard to how characters can be assigned, can perhaps be improved? It seems to consider the nature of a ship by checking the components by reverse index in the tree of components. This means, for example, that a ship with a Jump Stabilization module on which you add a very small troop component becomes a troop transport.
The most versatile approach would be to have the component added last to determine the nature of the ship; this way, a player can precisely decide what their ship should be considered. If not, then the costliest component should determine it.