Refine config file and consolidate logic

1. I now take the baseImagePath from the JSON object.
2. Take path of config file as a parameter now
3. Add package.json file for dependencies