TRUNK-3586 Update unit testing environment to use mocks

(cherry picked from commit 586ec2453942f474ef1d3ea625bfa0876ed4e1fd)
TRUNK-3586 Slightly improved and prepared for backporting

(cherry picked from commit bd5a8b0f294672f3fdf348270d41252c444d3d05)
Followup fix for: Ability to start all modules in their correct order -
TRUNK-4438
(cherry picked from commit 8ac9cd8cf48c15d55d46b787c23002db98709d56)
TRUNK-2999 Addressed more review comments

(cherry picked from commit f10bebefef9ada684f6b11d0de6fa0d377400c34)

Conflicts:
	web/src/test/java/org/openmrs/web/controller/form/FormFormControllerTest.java