Fixes #225: PHAR package support (second try)

#246 has been enhanced and improved.
Fixes #225.
Ready to be merged.