Fix BackgroundJobEnvironment, add tests to it

[#64676414]

Signed-off-by: Kris Kelly <kkelly@pivotallabs.com>