DOT templates no longer relying on hack to get refs.
Also fixed bug in template for img that resulted in filename being
visible in some output formats.
Removed test for found references, code now being removed.