From Movement Primitives to Distance Fields to Dynamical Systems