INT-2951 Polishing

Avoid IOS implementing ApplicationContextAware - simply
cast in setBeanFactory (if it's an application context).