Code cleanup: comments, deleted dead code.

Added InputBuffer class to clean up places where we need to write to a
ByteArrayOutputStream and then navigate the buffer like an InputStream

Added LogUtil to let us test if the Log class is in the classpath (important for
unit testing)