apigen.php in src directory

This keeps all application logic in the `src` dir. Also, it helps to run tests (on Windows) and creating PHAR.