Implements cache setting to enable or disable class instance cache
Disables class instance cache to avoid test dependencies and to simplify writing tests
Merge pull request #624 from nsendetzky/master

Implements factory cache setting and simpifies unit tests