php5-fpm-integration: Small fixes + refactoring (check in progress)