Add support for Unity PM API, a few tweaks to handle incoming data validly.

Results of hacking on the gem at the Allscripts Unity PM Workshop today.
This adds some simple switches to allow usage of the PM API, and a few other fixes.
Along with the rspecs, I've tested this using the sandbox PM environment on-site at Allscripts.