Begin upgrading Hibernate-ORM and Hibernate-Search

This commit includes the required changes to update hibernate-orm from
v3.5.6 to v4.3.5 and hibernate-search from v3.1.1 to v4.5.1. This also
includes most of the required changes to package names.

Note: THIS COMMIT WILL NOT BUILD. More changes are required to adapt to
changes in Hibernate's event listener registry and sessions.
Update Spring versions and artifact names

This updates the following components:

* spring-framework from v3.0.1 to v4.0.6
* spring-ldap from v1.3.0 to v2.0.2
* spring-security from v3.0.2 to v3.2.4

Note: OMERO still does not build at this stage.
Remove outdated fork of `ConcurrentStatisticsImpl`

Prior to this change, OMERO was injecting a custom fork of the
`org.hibernate.stat.ConcurrentStatisticsImpl` class used by Hibernate.
It is not clear if the original issue leading to the need for this fork
remains, but regardless the fork is now out of date. It is missing a
number of methods in the Hibernate v4.3.6 version of the class.
Removed `ome.tools.hibernate.CurrentSessionContext`

This class is no longer used anywhere in OMERO and is not compatible
with the most recent versions of Spring and Hibernate.
Migrate simple classes to hibernate4 equivalents

This commit contains a handful of "simpler" updates moving from
hibernate3 support in Spring to hibernate4. Specifically:

* `HibernateCallback`, `HibernateTemplate`, and `HibernateDaoSupport`
  work mostly the same in hibernate4, so import statements were simply
  updated (the `doInHibernate` method no longer throws `SQLException`s,
  though). Note: it is recommended to replace
  `HibernateCallback`/`HibernateTemplate` code with "plain" Hibernate
  style calls using the new `SessionFactory.getCurrentSession()` method
  introduced in Hibernate v3.0.1.
* The `allowCreate` parameter from the `HibernateTemplate` constructor
  was removed, as `HibernateTemplate` is now using `getCurrentSession()`
  under the covers.
* `SessionFactoryUtils` has been severely trimmed down in hibernate4. In
  particular, the `getSession()` method (along with the `allowCreate`
  parameter) has been removed in favor of `getCurrentSession()`.
* One instance where `HibernateInterceptor` was imported but not used
  was removed (`HibernateInterceptor` no longer exists in hibernate4).
* Import statements for a few exception classes were updated.
* Spring's `LocalSessionFactoryBean` now fulfills the role of both the
  hibernate3 version of the same bean and the hibernate3
  `AnnotationSessionFactoryBean`.
* The method signatures on some `UserType` methods that were overridden
  has changed.
Remove `HibernateInterceptor`

Due to a change in how Hibernate manages per-thread Sessions and
Spring's integration with this, the `HibernateInterceptor` is not
strictly necessary any longer.

More information on this ticket: https://jira.spring.io/browse/SPR-9028
Import `FilterDefinitionFactoryBean`

Spring is no longer supporting `FilterDefinitionFactoryBean` for
hibernate4, and the `filterDefinitions` property has been removed from
the `LocalSessionFactoryBean`. However, the same mechanisms using in the
`FilterDefinitionFactoryBean` and the various custom OMERO subclasses
should work. So this pulls the implementation of that bean into OMERO
and updates it for hibernate4 compatibility.
Update `MergeEventListener` for Spring+Hibernate4

The Spring team have stated that they will no longer be supporting the
`IdTransferringMergeEventListener` for hibernate4. However, the code
still works, so this just merges the (relatively small) implementation
of that listener with OMERO's `MergeEventListener`, which was the only
subclass in use.

See here for more info: https://jira.spring.io/browse/SPR-9634
Implement custom LocalSessionFactoryBean subclass

The hibernate4 version of Spring's `LocalSessionFactoryBean` has removed
support for specifying `eventListeners`, `filterDefinitions`, and
`lobHandler`. This is a simple custom subclass that adds back these
properties and wires them up appropriately. Notably, since Hibernate has
moved management of `eventListeners` to the `EventListenerRegistry`
which must be retrieved from the `ServiceRegistry`, we must call the
`buildSessionFactory` method *before* registering event listeners.

Note: It is still not clear to me how the `lobHandler` should be hooked
in, so it remains in the implementation as a property that can be
specified, but more work needs to go into connecting it appropriately.
Update SimilarTerms for Hibernate 4

In Hibernate-Search for Hibernate 4, the mechanism for accessing an
index reader has changed. This updates the `SimilarTerms` class for the
new mechanism.
Rewrite EventListenersFactoryBean to work with EventListenerRegistry

The new mechanism in Hibernate 4 for registering event listeners
requires retrieving an `EventListenerRegistry` instance and then
registering listeners with it. So, this changes the implementation of
`EventListenersFactoryBean` from generating a map of event listeners to
directly registering them with the `EventListenerRegistry`, which is
passed in during session factory creation in the
`LocalSessionFactoryBean`.
Increase heap space for build