Update index.js

refactoring getters and setters.  TO DO - guarantee edge uniqueness, implement array-based edge labelling everywhere.