Initial import from  https://falling-sky.googlecode.com/svn/trunk/extras r1511