Depencency tracking of headers now works properly

Also, processing dirty sources is now algorithmically more efficient