Fix way querying where options.useOriginalID === true
Fix idType assignment
Change the queueing logic

Previously, the way queue was started when the number of nodes processed
by the queue (queue.output.node?) was equal to the number of nodes saved
to the database (queue.input.node?). This did not guarantee that the
way queue started after all the nodes have been saved to the database,
as queue.output.node does not always equal the number of nodes that have
been read in. Furthermore, as this logic is in the closetag function, if
the last node to be saved, is saved once the ways have finished being
read in, the ways will never start to be processed.

I have moved this logic to the saveCB (such that it executes when a node
is saved), and changed it to check that the number of nodes that have been
read in (read["node"]) is equal to the number of nodes saved to the database
(self.input.node?). The relation queueing logic has been changed similarly.