Improve the javadoc testing stuff.

 - Compile the snippets statically to catch more problems.
 - Make the error messages more helpful by pointing to the actual source of the problem.