Keeping sort order of options

One last change:
If options are converted to JS, currently the suggestions are sorted by
id.
By writing the native option position to tag.sort the sortedOutput
parameter can be used to preserve the original sorting.