Statically resolve variable references

https://github.com/nathan/phosphorus/issues/188 for variables.