Improve the class loading. Fixes #1620 (This should be replaced by implementing PSR-0 in a later release)