Well I had a feeling that bringing in rewrite-clj would be worth it...
We have to parse each evaluation to see if it contains a namespace with a :require
and if so, inject them along with the Java interop namespaces. The trick was to keep track of the last namespace declaration evaluated and not replace it when evaluating a region that does not contain one.