Added support for removal of unused nodes.

    To further reduce output file size now pre-scans the way section
    and collects all nodes that are used in a way. Nodes that are not
    part of any way are removed