rewrite index.js using esprima-selector and falafel-helpers
better comment
fixed browser build