handle symlinks when determining prefix

also add some TODOs for myself