SSP-2241 Initialize SecurityContext before running background jobs

As described in patched javadoc, this works around a memory leak
caused by excessive SspUser creation in our Hibernate flush
interceptor when trying to look up the "auditable" current user.
Each of the those SspUser initializations ended up adding a
reference to a ThreadLocal list, which, for a "auditable-intensive"
job like external person sync, resulted in explosive growth in
list size and then GC thrash leading up to an OOM.

Conflicts:
	src/main/java/org/jasig/ssp/service/impl/ScheduledTaskWrapperServiceImpl.java

This was originally a cherry-pick of e060adbd708f74d13d5b64c31384bf2688d64622.
The conflict was a trivial imports discrepancy.
SSP-2305 Emulate OpenSessionInViewFilter for background jobs
SSP-2304 Reflect task name in thread name and Logback MDC
SSP-2305 Per-batch Hibernate sessions for external person sync

Conflicts:
	src/main/java/org/jasig/ssp/service/impl/ScheduledTaskWrapperServiceImpl.java

This was a cherry-pick from rel-2-2-patches. The conflicts were caused by
a feature add in the target branch (rel-2-3-patches) that changed method
signature in ScheduledTaskWrapperServiceImpl to support embedding task
names in background thread names.
SSP-2305 Per-batch Hibernate sessions for mail send job

Conflicts:
	src/main/java/org/jasig/ssp/service/impl/ScheduledTaskWrapperServiceImpl.java

This was a cherry-pick of 337e648d2cf41ca253bc2315d57a9555067b9b01 from
rel-2-2-patches. The conflicts were trivial to resolve and were caused
mainly by the target class having been previously modified to accept
a task name argument whenever executing a task.

Conflicts:
	src/main/java/org/jasig/ssp/service/impl/MessageServiceImpl.java

This was originally a cherry-pick of 2c07e6a581942c001f7a12f9d6598dbc33e19002.
Conflicts were a few trivial import collisions and an obsoleted dependency
on SessionFactoryUtils.openSession()
SSP-1923 Short-circuit term validation if no term offerings exist

Fixes a logic bug where the short-circuit was term-scoped and if
none of the currently planned courses in a term were valid, the
empty result set from the term-course lookup was interpreted as
there being no records in external_term_course, period, and all
courses in the term would be considered valid until at least one
actually valid course was planned.

Conflicts:
	src/main/java/org/jasig/ssp/service/impl/AbstractPlanServiceImpl.java

This was originally a cherry-pick of a6c45f7b8de05a9e8e886aa8e9f91fe8a309fa1f.
The conflicts ended up being fairly trivial and seem to have just been
caused by significant upstream changes to AbstractPlanServiceImpl having
relocated the patched loop.
SSP-2269 Fix up MAP tooltip grammar and language consistency
SSP-2305 Per-batch Hib sessions for MAP status calculation job

Also includes several improvements to batch jobs in general, including
a standardized interface (BatchedTask) and set up of the task-specific
Thread name at the start of the task rather than at the start of each
of the task's batches.

Conflicts:
	src/main/java/org/jasig/ssp/service/impl/MapStatusReportCalcTaskImpl.java
	src/main/java/org/jasig/ssp/service/impl/ScheduledTaskWrapperServiceImpl.java

This was originally a cherry-pick of b2ab846f574933c0be0239d0de4394912954306d.
Conflicts in ScheduledTaskWrapperServiceImpl were trivial - mainly just import
collisions. MapStatusReportCalcTaskImpl ended up being near-trivial but
in the end, just had to revert to "ours" and re-apply the patch by hand b/c
so many lines were affected, but many had just been shifted/relocated.
SSP-2305 Fix test compilation errors
SSP-47 Fix test compilation failures
NOJIRA Fix test startup against empty db

Conflicts:
	src/test/resources/test-config.xml

This was originally a cherry-pick of 49338f8a2549a1a0cbf8e554c7ea575b7a622037.
The conflict was trivial and was caused by the upstream Spring upgrade
breaking expectations about XML namespaces.
SSP-2324 Guard against missing terms