Make encode() return a String.
Remove logging.
Remove -DNDEBUG by default when indexing.