Rework logic to account for index.coffee

Also remove unnecessary index.js check