Move compilation unit handling to backend class.

This should also help make the addition of --target=pbc a bit cleaner.
Eliminate getprop/setprop usage.