Move STANDALONE flag to a module and unify get_path_prefix queries.