reorder functions
Better support for specifying [vm_name] to ACTIONS

Move env setup to init_static_env.