makes component methods use indices instead of ids
also fixes the example, touches up the docs, and further es6-ifies the code