Fix for issues with deepExtend and added tests
Refactor to have utility service