Imports the module dynamically

        _import_module('foo.bar') calls:
            __import__('foo.bar',
                       globals(),
                       locals(),
                       ['bar', ],
                       0)

def _import_module(module_name):
    """
        Imports the module dynamically

        _import_module('foo.bar') calls:
            __import__('foo.bar',
                       globals(),
                       locals(),
                       ['bar', ],
                       0)
    """
    fromlist = []
    dot_position = module_name.rfind('.')
    if dot_position > -1:
        fromlist.append(
            module_name[dot_position+1:len(module_name)]
        )

    # Import module
    module = __import__(module_name, globals(), locals(), fromlist, 0)

    return module