port relevant parts of cljs.analyzer