Change VM to use weak reference to delegate

This commit changes the VM to have a weak reference to its delegate
instead of a strong reference. There is currently a bug in Swift where
you need to use the `@objc` prefix on the protocol the delegate
implements in order to have a `weak` reference to it. This commit also
makes that change.