adding packaging scripts, refactored out unused cruft; updating LICENCE to match apache 2.0 licence in PHP source files.