Undo improvement

The index function inside undo has been improved to return both an integer and a bool value to indicate success. View and undo_test had to be slightly modified to reflect this change. Go tests on the backend succeed and I've run the format fixer on these files before uploading.