Improve php implementation

I've refactored our instant login token exchange sample code for PHP with a few goals in mind:
* Bring parity with @aashay's awesome Python version
* Modernize the PHP while remaining procedural and generally backwards-compatible with older PHP versions
* Add unit tests around important functionality
* Make the sample code better suited to developer adoption (it's not production-ready, but much closer)