memory leak prevention: Weak reference to ITestCase
Removes compiler warnings about methods or variables not used.

Later this code will disappear completely.
Fixes compiler hints about unused units in uses clauses.
Minor change so FPC under *nix doesn't complain.