semantic: Break up class parent resolving into own function.

This gives us some measure of independence from module order in this case.