Support environments that don't have CDI

This PR adds the extra mechanics needed to make this usable without CDI.

The last two commits aren't required for this, but they were necessary changes that showed up when I was testing it with SSW.