Package fix + type mapping through configuration (based on dyadyavasya's work)

The package can now be build (originally failed for me) either with php package.php or phing (2.6.1) on Windows with PHP 5.5.7.
Cherry-picked dyadyavasya's type mapping options and changed a bit.