Tweak pkproto to run on mac.
Add test scripts.