move pidList logic to single place

Same as my previous (closed) PR, but with changes to studio and unintentionally included level.js removed.