Order field names

This fixes #8

I've also added some documentation.