Clean up bag tests

Move pig code into java files.
Merge pull request #46 from matthayes/master

Clean up bag tests