Fix load order for test classes and factories