MODE-2145 Upgraded JUnit to 4.11 and hamcrest to 1.3. Fixed additional issues caused by the upgrade.