Move attach, detach, pageToLocal and localTopPage to View