Refactor index fields

A possible solution for #77.

This uses nested `Map`s and `Array`s and converts them to `FieldValue`s to represent the fields structure. I'm fairly confident that this won't affect the majority of current users but there might be some breakages for some scenarios.

Any comments/feedback is welcome.