Previously it would break if you flushed a parent cache while there was a child cache referring to it. This change will allow the flushing of parent caches.
Make sure that chainparams and logging is properly initialized. Doing
this for every test may be overkill, but this initialization is so
simple that that does not matter.
This should fix the travis issues.