Add service provider api to get instances of various services

Added a unit test. Existing tests are passing. @sumashivaprasad @Amareshwari  pls review.
Will there be anyother implementation of service provider factory? I see a configuration added, what sort implementation are we expecting