Fix migrations for MP_Tree

The migration mistakenly adds MP_Tree path field as unique before creating the field.
Added migration to make Page.path unique after the data migration
Merge pull request #3537 from jsma/migrations-fix2

Fix migrations for MP_Tree
ToolbarMiddleware.process_response: conditional refactor

Changed loop into a 'not all()' call and replaced "found" bool with combined clauses
PluginPool.get_text_enabled_plugins(): refactor using set()

The loop collected unique plugins with a true text_enabled attribute.
It was replaced with a list comprehension filtering a set of unique plugins.
cms.utils.urlutils refactors

levelize_path(): list comp
prepend slash explicitly, not relying on join of empty string
splitting all slashes and filtering empty strings also converts paths with
consecutive slashes

urljoin():
The conditionals became simpler because '/'.join(stripped) never could have
started or ended with a slash
cms.utils.i18n: builtins refactors

get_language_list, get_language_tuple, get_public_languages: list comps
get_language_dict: dict(get_language_tuple)
is_language_prefix_patterns_used: any()
cms.models.pluginmodel: builtin refactors

CMSPlugin:
.__reduce__(): list comp
.get_translatable_content(): now filters using generators/filter
Simplified predicate collecting the fields (one isinstance, removed "and f")
.set_translatable_content(): all()

various conditionals replaced with ternary or 'or'
menus.*: comprehensions, infix if/else, shortcut or

MenuPool.get_menus_by_attribute():
The value parameter shouldn't be None so the hasattr() call was dropped.
ToolbarPool.get_watch_models: sum() refactor
cms.utils.django_load: iterator and sum() refactors

import iterative map and filter

iterload(): filter()
iterload_objects(): map()
get_subclasses(): recursive sum(..., [])

Added DjangoLoadTestCase to cover iterload() and verify signatures
cms.utils.plugins: builtins and std library refactors

import iterative filter/filterfalse

requires_reload(): any()
downcast_plugins(): list comp

assign_plugins():
Moved invariant toolbar conditionals to top level. Pulled plugin placeholder_id
check loop into an all() inside a new disjoint_placeholders filter. The
build_plugin_tree query near the end was simplified since it can now accept an
iterable.

create_default_plugins():
    _can_add_plugin():
nested "partial" predicate extracted from both previous create_default_plugins
functions
    _create_default_plugins():
New recursive auxillary function that provides the core logic common to both
previous create_default_plugins functions. Nesting the function allows
parameter simplification since request and lang stay constant. The add_plugin()
call now provides parent plugins as the target keyword, simplifying the logic
and halving the save() method calls.
The continue statements inside the core placeholders loop were transformed into
declarative filters/generator expressions feeding the core placeholders
iteration.

create_default_children_plugins():
merged into create_default_plugins as a nested auxillary function

build_plugin_tree():
Reworked to do a groupby query and documentation added. Now also accepts an
iterable. Python3 requires partitioning roots and nonroots to sort on the
parent_id attribute. Sorting the nonroots allows grouping and guarantees the
children tuples are sorted.
cms.utils.copy_plugins.copy_plugins_to(): reworked, new code reuse

Now returns the list of new plugins, rather than new and old plugins zipped.
Behavior was retained, since the return value was only used once, in a len().
If the recipient wants the previous result, they can rezip the result and the
submitted parameter. This allowed the reuse of copy_plugins_to() and
encapsulated the mutating old_parent_cache parameter.

cms.utils.placeholder.MLNGPlaceholderActions.copy():
now reuses copy_plugins_to()