Adding test for private key checking

Adding test, and avoid spinning up preg engine.
Merge and modification of #36

Adding Curl support, including tests.
Fix typo in exception

Resolves #84
Merge pull request #93 from ianbarber/master

Curl support and direction private key modifications