Add jpharvest tests, and refactor common test code.