rewrite "with" syntax usage for python 2.4 compat
replaced more "with" syntax
Merge pull request #112 from pall-valmundsson/replacewithsyntax

rewrite "with" syntax usage for python 2.4 compat