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