Zza refactoring for improved testing: breakout entityManagerProvider
Also converted untested database reset to own file and using $http