Script calling cleanups

· Use env(1) in shebangs instead of hardcoding paths.
· $IP is already set in the constructor of Maintenance classes.
· Add sapi guard to some phpunit files.

Change-Id: I6c6fd6c61e2861b5992f2ccd67a4e3f62e2c445e
Merge "Script calling cleanups"