Initial commit from cynin svn tagged 3.1.3