Added automatic node ID assignment when requested. All seen IDs are stored in a file to minimise the risk of duplicates when mixing with manual assignments.