Switch back to tracking upstream string-cache
Refactor most of env into a trait
Correctly bind type variables in functions