Restore Spring Security version 3.1

Spring 3.2 should be compatible with Spring Security 3.1, so it should be possible to update one by one.

This is a WIP commit, there is still a 500 error caused by the Spring 3.1-3.2 upgrade
WIP: repairing handler mapping configuration problems caused by HandlerAdapterFactoryBean