Finished delete-index function

Finished the implementation of the delete-index function and added unit tests for it.

With delete-index working, wrote tests and then fixed up the delete function, which leverages delete-index funciton.