CB-7978 Cleaning code and creating temporary dir
- Cleaning code
- Declaring variables only when needed
- Creating chrome for Cordova temp dir prior using it by std and err