Remove unused existing code.
Move STANDALONE flag to a module and unify paths queries.