Fixed example index.php
Moved code from index.php into Application class