Change getEntityManger to getManager().

getEntityManger is deprecated in 2.2
Update validations to reflect deprecated MinLength in 2.2.
Fix test error, also update doctrine dev-dependency (composer would barf if not).
Merge pull request #351 from tarjei/deprecated-2

[2.2] Change usage from deprecated methods