Add support for "p" parameter. Add tests.

Closes #181.

Please review @tlovett1.