pull loading code out of texture into linemap (and soon into document...)