Change the Settings cache check in tests to improve performance
Change the Settings cache check in tests to improve performance

Settings.to_json is done twice for every single test in order to determine if
the Settings have been changed. Instead, we make 2 performance changes here.
First, we memoize the original settings and restore from those. This alone cuts
the time needed in half. For the other half, we prefer Marshal dump over
to_json, which is roughly 8x faster. Note that Marshal dump of Settings doesn't
dump the config_sources, so a number of helper methods are introduced to ensure
those haven't been changed, and on restore that those config_sources are also
restored.

In a local manual test, the vmdb test suite (11465 examples) dropped from
19m40s to 16m14s (saving 3m26s / 17.4%). The spec:routes test suite from
manageiq-ui-classic (3043 examples), which is more of a purer Ruby test, went
from 1m20s to 12s (saving 1m8s / 85%). From these 2 data points, we can
then expect roughly 1 minute of savings for every 3000 examples.

mzazrivec/manageiq,billfitzgerald0120/manageiq,jvlcek/manageiq,NickLaMuro/manageiq,ManageIQ/manageiq,billfitzgerald0120/manageiq,skateman/manageiq,kbrock/manageiq,djberg96/manageiq,NickLaMuro/manageiq,chessbyte/manageiq,d-m-u/manageiq,lpichler/manageiq,agrare/manageiq,agrare/manageiq,chessbyte/manageiq,ManageIQ/manageiq,lpichler/manageiq,jrafanie/manageiq,NickLaMuro/manageiq,djberg96/manageiq,d-m-u/manageiq,mzazrivec/manageiq,agrare/manageiq,lpichler/manageiq,jrafanie/manageiq,mzazrivec/manageiq,jvlcek/manageiq,gmcculloug/manageiq,jrafanie/manageiq,d-m-u/manageiq,ManageIQ/manageiq,skateman/manageiq,jrafanie/manageiq,agrare/manageiq,NickLaMuro/manageiq,skateman/manageiq,chessbyte/manageiq,gmcculloug/manageiq,ManageIQ/manageiq,kbrock/manageiq,billfitzgerald0120/manageiq,skateman/manageiq,kbrock/manageiq,jvlcek/manageiq,chessbyte/manageiq,gmcculloug/manageiq,djberg96/manageiq,billfitzgerald0120/manageiq,jvlcek/manageiq,djberg96/manageiq,gmcculloug/manageiq,d-m-u/manageiq,lpichler/manageiq,mzazrivec/manageiq,kbrock/manageiq