pts-core: Code clean-ups, Phoromatic prep work for web UI interface