Ecology and Genomic Insights into Plant-Pathogenic and Plant-Nonpathogenic Endophytes.