Add peg module and corresponding tests.

This would probably be better as a submodule or a subtree. But for
my purposes, this is fine for now.