Universal addon registering

I did some tests and concluded that there is a way to recover the behaviour of the register_module() function.
I would like your opinion about this:

the solution is quite convoluted and big but works both in 2.7 and 2.8.

bl_info = {
    "name": "myaddon",
    "description": "it does stuff",
    "author": "me",
    "version": (500, 499, 1),
    "blender": (2, 80, 0),
    "location": "View3D",
    "warning": "This is an test script",
    "wiki_url": "",
    "category": "Object" }

modules = [
    "my_module",
    "module_that_does_stuf",
    "my_mesh_stuff",
    "ui_panels",
]

import importlib
import bpy

for module in modules:
    if module in locals():
        importlib.reload(module)
    else:
        exec("from . import %s" % module)

classes = []

for module in modules:
    module = locals()[module]
    attributes = dir(module)
    for thing in [getattr(module, attr) for attr in attributes]:
        if hasattr(thing, "bl_idname"):
            classes.append(thing)

def register():
    for cls in classes:
        bpy.utils.register_class(cls)

def unregister():
    for cls in classes:
        bpy.utils.unregister_class(cls)

register_module was a python defined function before in 2.7x located in modules/bpy/utils

The function was removed for the reasons explained in the Python changes related task: https://developer.blender.org/T47811

Benefit: Remove internal code that currently needs to keep track of a classes module when its registered.
Also prefer explicit over implicit classes for registration.

The preferred way of declaring the classes will probably defined in the documentation on the wiki.