Tidy up implementation of DispatcherServletAutoConfiguration

also adds another test.