Shouldn't the above three blocks (up to and including `attempts`) be moved out if this if, and be executed regardless of whether `main` is defined in `bower.json`? It makes sense that we use index.js as a fallback.