IResources, DRY principle, testing

Added more generic IResources interface as the main interface for
online/offline elastic search mode.   Updated OnlineMode and OfflineMode
classes with new interface.

Eliminated duplicate online/offline elastic search checking.

Updated tests with new changes.