TestEnv: Clean up setting devlib modules
TestEnv: Clean up setting devlib modules

- Use a local variable to avoid repeatedly converting between list and set, then
  use set operations to simplify code that chooses modules.
- Simplify conditionals by assuming test_conf and target_conf are not None
- Use dict.get to simplify conditionals

credp/lisa,ARM-software/lisa,bjackman/lisa,ARM-software/lisa,arnoldlu/lisa,mdigiorgio/lisa,credp/lisa,ARM-software/lisa,credp/lisa,joelagnel/lisa,bjackman/lisa,joelagnel/lisa,credp/lisa,arnoldlu/lisa,ARM-software/lisa,mdigiorgio/lisa