Refactored test utility classes into lib subpackages.