Feature/fix change instances

This PR is mainly about critical bug fix on change instance and also in general on handling container failure
- Fix infinite blocking when requested to change to same number of instances as what currently is.
- When container failed with error, try restart it if the error is not a user error exit.
- Added cluster capacity check when requesting for new container
- Some code refactoring to make code cleaner.