o Move STANDALONE flag to a module and unify get_path_prefix queries. Closes #3636.