Multiple fixes to deploy script

- Formatting fixes
- Environment config file changes
- DB restore app-db checks
- APP_NAME used as db name
Added -e (existing app) option to deploy script.

- Option addition
- Minor refactoring