swap_resources_into_scope function
head.str
subterms on object yields object
Switch order of args in Apply
introduce empty optimize function
test for optimize
py26 compatibility

dict comprehension -> dict((, ), ...)
remove debug print code
Merge pull request #744 from mrocklin/optimize

 Optimize framework