Various refinements, particularly to test execution and shared lib generation.