optimizations to inference.jl

ditched @devec macro; hand-rolled loops faster & less memory