Rewrite instrumentation test helper to not use NIO.
Fix build configuration for Java 6 support.