The Effects of Competition and Ecological Opportunity on Adaptation and Diversification