Implement index de/serialization, and switch to string keys for indexes