export function loadPage(module, target){
    let createFn = module.default||module.create;
    if(!target){target = document.body;}
    if(createFn){
        let ctarget = target.cloneNode(false);
        target.parentNode.replaceChild(ctarget,target);
        // TODO pass query params
        let elements = createFn();
        for(let element of elements){
            ctarget.appendChild(element);
        }
    }else{
        console.error("No default! Cannot create", module);
    }
}