Handle nested forms
Add support for complex local variables
Remove unused environment support