Add l3 db migration for plugins which did not support in folsom

Bug 1153585

Several plugins added l3 support in the grizzly release. This means that
when upgrading from the folsom data model, the relevant data model changes
should be applied.
In order to do so this patch refactors the initial migration in order
to be able to reuse the upgrade_l3 and downgrade_l3 routines.

Change-Id: I876f6d637665e10fb09d2084bb8a545ce469fbf3
Merge "Add l3 db migration for plugins which did not support in folsom"