func (vm *VM) Run(mainPackage string) error {
	if err := vm.prepareGlobals(); err != nil {
		return err
	}
	mainFunction := vm.Globals[mainPackage].Map["main"].Value
	_, err := vm.call(mainFunction, nil, map[string]*ast.Literal{},
		types.Any, "")
	if err != nil {
		return err
	}
	vm.catchUnhandledError()
	return nil
}
Run will run the program. That is, execute the "main" function. If there is
no main() method then nothing will run, but no error will be raised.

TODO(elliot): Change missing main into an error in the future. It was done
this way so I could use "ok run" like an "ok compile" (that didn't exist at
the time) for compiling the standard libraries.
package vm
import (
	"fmt"
	"io"
	"math/rand"
	"os"
	"regexp"
	"runtime/debug"
	"sort"
	"strings"
	"time"
	"github.com/elliotchance/ok/ast"
	"github.com/elliotchance/ok/ast/asttest"
	"github.com/elliotchance/ok/types"
)
const (
	StateRegister = "0"
	StackRegister = "__stack"
)
type CompiledTest struct {
	*CompiledFunc
	TestName string
}
type VM struct {
	fns map[string]*CompiledFunc
	Return []Register
	Stack  []map[Register]*ast.Literal
	tests  []*CompiledTest
	pkg    string
	Stdout io.Writer
	TestsPass, TestsFailed int
	TotalAssertions        int
	CurrentTestName        string
	CurrentTestPassed      bool
	ErrType  *types.Type
	ErrValue *ast.Literal
	ErrStack []string
	FinallyBlocks [][]*FinallyBlock
	rand *rand.Rand
	Types map[TypeRegister]*types.Type
	Symbols map[SymbolRegister]*ast.Literal
	Globals       map[string]*ast.Literal
	GlobalsToLoad map[string]string
}
func NewVM(pkg string) *VM {
	return &VM{
		fns:     make(map[string]*CompiledFunc),
		pkg:     pkg,
		Stdout:  os.Stdout,
		rand:    rand.New(rand.NewSource(int64(time.Now().Nanosecond()))),
		Types:   map[TypeRegister]*types.Type{},
		Symbols: map[SymbolRegister]*ast.Literal{},
		Globals: map[string]*ast.Literal{},
	}
}
func (vm *VM) prepareGlobals() error {
	for name, uniqueName := range vm.GlobalsToLoad {
		registers, err := vm.call(uniqueName, nil,
			map[string]*ast.Literal{}, types.Any, "unknown")
		if err != nil {
			return err
		}
		vm.catchUnhandledError()
		vm.Return = nil
		vm.Set(Register(name), vm.Get(registers[0]))
	}
	return nil
}