Addressed ERRAI-561 and added tests
Clear entity manager before running each test to prevent wacky
side-effects.