use testEnvironment to switch between YARN and local mode in some tests;
move context/poison tests into fail/ package; minor refactorings; added
tests to the proper test suite