Add last_error to improve error reporting
Lazily create environments

Many scopes never store any local variables, so spending 32 bytes on an
environment that isn't going to be used anyway is not necessary.