+ fix audit viewer after refactoring
Fixed exceptions caused by missing USER_AGENT (monitoring)
[OE-3192] fixed audit interface
fixed redirects to / when running in a subdirectory
optimised sql queries, gordan found that logging in and then loading the correspondence create form was taking over 1000 sql queries (!)
Merge branch 'feature/make-gordan-happy' into release/1.4

Conflicts:
	protected/components/UserIdentity.php
	protected/controllers/PatientController.php
	protected/models/Audit.php
	protected/models/Firm.php