How should operator id_remap be used?
The following should work with Blender 2.7x.

import bpy


def AssembleOverride(atype, rtype):
    for oWindow in bpy.context.window_manager.windows:
        oScreen = oWindow.screen
        for oArea in oScreen.areas:
            if oArea.type == atype:
                for oRegion in oArea.regions:
                    if oRegion.type == rtype:
                        oContextOverride = {
                                'window': oWindow,
                                'screen': oScreen,
                                'area': oArea,
                                'region': oRegion,
                                'scene': bpy.context.scene,
                                'edit_object': bpy.context.edit_object,
                                'active_object': bpy.context.active_object,
                                'selected_objects': bpy.context.selected_objects
                                }
                        print("-AssembleOverride() created override context: ", oContextOverride)
                        return oContextOverride
    raise Exception("ERROR: AssembleOverride()")
# ['EMPTY', 'VIEW_3D', 'TIMELINE', 'GRAPH_EDITOR', 'DOPESHEET_EDITOR',
# 'NLA_EDITOR', 'IMAGE_EDITOR', 'CLIP_EDITOR', 'SEQUENCE_EDITOR',
# 'NODE_EDITOR', 'TEXT_EDITOR', 'LOGIC_EDITOR', 'PROPERTIES', 'OUTLINER',
# 'USER_PREFERENCES', 'INFO', 'FILE_BROWSER', 'CONSOLE']
atype = 'OUTLINER'
# ['WINDOW', 'HEADER', 'CHANNELS', 'TEMPORARY', 'UI', 'TOOLS',
# 'TOOL_PROPS', 'PREVIEW']
rtype = 'WINDOW'

override = AssembleOverride(atype, rtype)
# old_id and  new_id must be pre-existing or operator will fail
bpy.ops.outliner.id_remap(
        override,
        id_type='MATERIAL',
        old_id='Material.002',
        new_id='Material.001'
        )