Removed cyclic references from Transformer

Removed as much state as possible from Transformer and ensured that it isn’t getting passed into any methods on itself, to avoid leaks in older versions of Firefox.