Detect and use a testing interface

This allows testing frameworks to hook into Pig and makes testing Pig handlers much simpler.
Merge pull request #23 from ribot/feature_testing_interfac

Detect and use a testing interface