Implement index operators

Closes #18