keep tag order (no reverse iteration)

Iterate tags in regular instead of reverse order to keep tag ordering (where supported), e.g. pbf.html example:
old:

    way:      {... ,"tags":{"name":"üßé€","highway":"service","access":"private"}, ...
    relation: {... ,"tags":{"type":"route","route":"bus","ref":"123","network":"VVW"}, ...

new (order as defined in test.xml/.pbf):

    way:      {... ,"tags":{"access":"private","highway":"service","name":"üßé€"}, ...
    relation: {... ,"tags":{"network":"VVW","ref":"123","route":"bus","type":"route"}, ...

@marook: Was there a reason to do a reverse iteration? It's not actually wrong as object keys are not guaranteed to be returned in the order added, but they usually are, so I don't see why not to keep that order.
there are some browsers for which the two lines make a performance difference. see http://jsperf.com/array-length-performance for performance details.

the difference is that the --i approach must only once evaluate entity.keys.length. the ++i case evaluates entity.keys.length on every loop (just in IE, opera / not in chrome, firefox)

i think the best way would be putting entity.keys.length into a variable and then use the variable in the for loop. then we got the fast iteration and the correct order... what do you think?