NXBT-872: cleanup&format

Add debuging comments on tests
NXBT-872: Do not ignore Studio packages if indirectly involved
NXBT-872: optimize packages queries