AppController now returns environment exit code.

- Returns 0 on successful run
- Returns 1 on any error case
- Updated/added tests for the current cases