When tackling this, try to use PSR-4 based loading, as done for instance in Wikibase DataModel. In Wikibase.git we are using classmaps, which is better avoided altogether