- make code more readable
- add a timeout for 1 second so an application can start in case the
next command is wait and it comes before the application has started for
whatever reason. it has happened...
- added three new commands: shutdown, close, killhung
- simplified the process check in the wait function.