Exec refactoring

Remember to merge https://github.com/appium/appium/pull/4103 after this.
I was going to do that, then I noticed we just cut and pasted 524288 everywhere, even in some places where it is not needed. The default is 200*1024, do we really want to increase it to 512*1024?