Add test utility for generating Jar files with compiled classes.

This was requested by a few different people and may be generally
useful, so I'd like to contribute this and not block on a different
PR for it to get in.