This is slightly more code, but I think is a bit cleaner, especially for
functions that set or could set multiple values, like the currently
unimplemented index parsing. It also removes the string manipulation as
a side-effect of case match thing, which was weird.
I believe the structure is correct, but there are a lot of details to
fill in - translating the C string parsing logic into Go is not always
straightforward.