Load and return a module based on C{mod_name}.

def get_module(mod_name):
    """
    Load and return a module based on C{mod_name}.
    """
    if mod_name is '':
        raise ImportError('Unable to import empty module')

    mod = __import__(mod_name)
    components = mod_name.split('.')

    for comp in components[1:]:
        mod = getattr(mod, comp)

    return mod