Use stderr for docgen and hierarchy

Similar to #453.