Cleanup of fields_for_document. Finally keep the fields in creation order too. Closes #1 (Yay)