cloned from http://appengine-pipeline.googlecode.com/svn/trunk/