Fix PHP warnings
Fix typo
Use dirname(__FILE__) instead of APPROOT and ensure proper start cwd
Create templates_c/ automatically if needed, with proper permissions
Make index.php a real front controller, move login.php and logout.php to includes/
Move front controller to includes/main.inc.php, shorten index.php to a minimum
Avoid the "index.php" part in links and redirects
Add .gitignore
Introduce public/ directory, split templates into private and public part
Put template cache and PHP session files under ./var/