Modified link module to correctly inherit the link_cxx property from depdirs.
Moved utility functions into a separate module.
Fixed run loop termination condition.