O.M.G.
Found the bug. Squished bug. Bedtime.
*************************************
problem was in Database constructor, which looked like:
Database(inputData){
linksAdded = inputData
results = inputData
}
-- in other words, linksA and results ended were just pointing to the
same list, which was why the both had the exact same content. Really
wish I'd worked this out quicker... :(
There is also now a BUTTLOAD of debug nonsense all over the crawler
which I just can't be bothered to get rid of now. Must sleep...