move and refactor vm analysis

Requires #1177 & #1173 
I've put it in #1294