DRY out index.php, moving most logic into app/kohana.php, fixes T205

Summary:
Moves a large block of Kohana boilerplate code into `application/kohana.php`.
Simplifies `application/tests/bootstrap.php` by using the new `kohana.php`.

Test Plan:
- open web app
- run phpunit and behat tests
- check that nothing breaks

Reviewers: rjmackay

Reviewed By: rjmackay

Maniphest Tasks: T205

Differential Revision: https://phabricator.ushahidi.com/D55