Now preserves order, delays sorting attributes until later.  Fixes #1.