GUVNOR-2140: Recursion in ClassFactBuilder leads to StackOverflow when loading in assets into project model cache. More tests.

(cherry picked from commit fe0d9e6e7648db814190387da6d7c89860306e89)