Add reimplementation of PBS support

(sorry for mucking up the merge and adding #2's commit)

The prodcommon side of changes needed for PBS support