Generate runtime vars before scope vars (fixes #215)

This ensures `nil` is available within the relevant scope, which local
variables assign to.