added ManyToMany relationships where it seems needed - used through to deal with sort_orders