Morph code to be closer to upstream

The only important change is changing (back) some of the field names
in SerializedRange, so that it's identical to the ones used by upstream.
Cosmetix fixes only