ExtGstate scanner now scans all references

Code looks very repetitive, should be looked at further, works for now.